Skip to content

Commit 9821920

Browse files
committed
Fix Issue #140
1 parent 695ff81 commit 9821920

14 files changed

Lines changed: 87 additions & 1329 deletions

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if(enable-python-bindings)
4141
message(STATUS "python include path ${PYTHON_INCLUDE_DIRS}")
4242
message(STATUS "python libraries path ${PYTHON_LIBRARY_PATH}")
4343
message(STATUS "python library ${PYTHON_LIBRARY}")
44-
string(REGEX REPLACE "[a-z]+.*$" "" PYTHONLIBS_VERSION_CLEANED ${PYTHONLIBS_VERSION_STRING})
44+
string(REGEX REPLACE "[-a-z+]+.*$" "" PYTHONLIBS_VERSION_CLEANED "${PYTHONLIBS_VERSION_STRING}")
4545
find_package(PythonInterp ${PYTHONLIBS_VERSION_CLEANED} REQUIRED)
4646
message(STATUS "python interpreter ${PYTHON_EXECUTABLE}")
4747
if(NOT HAVE_PYTHON)
@@ -215,6 +215,7 @@ endif(TFEL_FOUND)
215215

216216
# add a target to generate API documentation with Doxygen
217217
option(enable-doxygen-doc "enable generation of the Doxygen documentation" OFF)
218+
option(enable-website "enable generation of the website" ON)
218219

219220
if(enable-doxygen-doc OR enable-website)
220221
add_custom_target(doc)
@@ -242,9 +243,8 @@ else(enable-doxygen-doc)
242243
message(STATUS "doxygen documentation is not enabled")
243244
endif(enable-doxygen-doc)
244245

245-
option(enable-website "enable generation of the website" ON)
246+
set(MGIS_GENERATE_WEBSITE OFF)
246247
if(enable-website)
247-
set(MGIS_GENERATE_WEBSITE OFF)
248248
# Looking for pandoc (http://johnmacfarlane.net/pandoc)
249249
include(cmake/modules/pandoc.cmake)
250250
if(MGIS_HAVE_PANDOC)

bindings/python/src/FiniteStrainSupport.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
// forward declaration
2222
void declareFiniteStrainSupport();
2323

24-
void py_convertFiniteStrainStress(boost::python::object o,
25-
const mgis::behaviour::MaterialDataManager& m,
26-
const mgis::behaviour::FiniteStrainStress t) {
24+
static void py_convertFiniteStrainStress(
25+
boost::python::object o,
26+
const mgis::behaviour::MaterialDataManager& m,
27+
const mgis::behaviour::FiniteStrainStress t) {
2728
auto s = mgis::python::mgis_convert_to_span(o);
2829
mgis::behaviour::convertFiniteStrainStress(s, m, t);
2930
} // end of py_py_convertFiniteStrainStress
3031

31-
void py_convertFiniteStrainTangentOperator(
32+
static void py_convertFiniteStrainTangentOperator(
3233
boost::python::object o,
3334
const mgis::behaviour::MaterialDataManager& m,
3435
const mgis::behaviour::FiniteStrainTangentOperator t) {

bindings/python/src/Integrate.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ MaterialDataManager_executePostProcessing2(
130130
return mgis::behaviour::executePostProcessing(output, m, n, b, e);
131131
}
132132

133-
mgis::behaviour::MultiThreadedBehaviourIntegrationResult
133+
static mgis::behaviour::MultiThreadedBehaviourIntegrationResult
134134
MaterialDataManager_executePostProcessing3(
135135
boost::python::object o,
136136
mgis::ThreadPool& t,

bindings/python/src/Variable.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ static const char* Variable_getType(const mgis::behaviour::Variable& v) {
3131
case Variable::TENSOR:
3232
return "Tensor";
3333
default:
34-
mgis::raise("Variable_getType: unsupported type");
34+
break;
3535
}
36-
return "";
36+
mgis::raise("Variable_getType: unsupported type");
3737
} // end of Variable_getType
3838

3939
// mgis::string_view is not exposed

include/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ mgis_header(MGIS Raise.ixx)
55
mgis_header(MGIS Raise.hxx)
66
mgis_header(MGIS Span.hxx)
77
mgis_header(MGIS StorageMode.hxx)
8-
mgis_header(MGIS StringView.hxx)
9-
mgis_header(MGIS StringView.ixx)
108
mgis_header(MGIS ThreadPool.hxx)
119
mgis_header(MGIS ThreadPool.ixx)
1210
mgis_header(MGIS ThreadedTaskResult.hxx)

include/MGIS/Behaviour/MaterialStateManager.hxx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
#include <string>
2020
#include <vector>
2121
#include <variant>
22+
#include <optional>
23+
#include <string_view>
2224
#include "MGIS/Config.hxx"
2325
#include "MGIS/Span.hxx"
2426
#include "MGIS/StorageMode.hxx"
25-
#include "MGIS/StringView.hxx"
2627

2728
namespace mgis::behaviour {
2829

@@ -191,7 +192,7 @@ namespace mgis::behaviour {
191192
* \param[in] v: value
192193
*/
193194
MGIS_EXPORT void setMaterialProperty(MaterialStateManager&,
194-
const mgis::string_view&,
195+
const std::string_view&,
195196
const real);
196197
/*!
197198
* \brief set the given material property
@@ -201,7 +202,7 @@ namespace mgis::behaviour {
201202
* \param[in] s: storage mode
202203
*/
203204
MGIS_EXPORT void setMaterialProperty(MaterialStateManager&,
204-
const mgis::string_view&,
205+
const std::string_view&,
205206
const mgis::span<mgis::real>&,
206207
const MaterialStateManager::StorageMode =
207208
MaterialStateManager::LOCAL_STORAGE);
@@ -213,7 +214,7 @@ namespace mgis::behaviour {
213214
* \param[in] s: storage mode
214215
*/
215216
MGIS_EXPORT bool isMaterialPropertyDefined(const MaterialStateManager&,
216-
const mgis::string_view&);
217+
const std::string_view&);
217218
/*!
218219
* \brief set the given material property
219220
* \param[out] m: material data manager
@@ -222,15 +223,15 @@ namespace mgis::behaviour {
222223
* \param[in] s: storage mode
223224
*/
224225
MGIS_EXPORT bool isMaterialPropertyUniform(const MaterialStateManager&,
225-
const mgis::string_view&);
226+
const std::string_view&);
226227
/*!
227228
* \brief set the given external state variable
228229
* \param[out] m: material data manager
229230
* \param[in] n: name
230231
* \param[in] v: value
231232
*/
232233
MGIS_EXPORT void setExternalStateVariable(MaterialStateManager&,
233-
const mgis::string_view&,
234+
const std::string_view&,
234235
const real);
235236
/*!
236237
* \brief set the given external state variable
@@ -241,7 +242,7 @@ namespace mgis::behaviour {
241242
*/
242243
MGIS_EXPORT void setExternalStateVariable(
243244
MaterialStateManager&,
244-
const mgis::string_view&,
245+
const std::string_view&,
245246
const mgis::span<mgis::real>&,
246247
const MaterialStateManager::StorageMode =
247248
MaterialStateManager::LOCAL_STORAGE);
@@ -253,16 +254,14 @@ namespace mgis::behaviour {
253254
* \param[in] s: storage mode
254255
*/
255256
MGIS_EXPORT bool isExternalStateVariableDefined(const MaterialStateManager&,
256-
const mgis::string_view&);
257+
const std::string_view&);
257258
/*!
258259
* \return true if the given external state variable is uniform.
259260
* \param[out] m: material data manager
260261
* \param[in] n: name
261-
* \param[in] v: values
262-
* \param[in] s: storage mode
263262
*/
264263
MGIS_EXPORT bool isExternalStateVariableUniform(const MaterialStateManager&,
265-
const mgis::string_view&);
264+
const std::string_view&);
266265
/*!
267266
* \brief update the values of a state from another state
268267
* \param[out] o: output state
@@ -283,7 +282,7 @@ namespace mgis::behaviour {
283282
MGIS_EXPORT void extractInternalStateVariable(
284283
mgis::span<mgis::real>,
285284
const mgis::behaviour::MaterialStateManager&,
286-
const mgis::string_view);
285+
const std::string_view);
287286

288287
} // end of namespace mgis::behaviour
289288

include/MGIS/Behaviour/State.hxx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
#include <iosfwd>
1919
#include <vector>
20+
#include <string_view>
2021
#include "MGIS/Config.hxx"
2122
#include "MGIS/Span.hxx"
22-
#include "MGIS/StringView.hxx"
2323
#include "MGIS/Behaviour/StateView.hxx"
2424

2525
namespace mgis::behaviour {
@@ -74,14 +74,14 @@ namespace mgis::behaviour {
7474
* \param[in] n: name
7575
* \param[in] v: value
7676
*/
77-
MGIS_EXPORT void setGradient(State&, const string_view, const real);
77+
MGIS_EXPORT void setGradient(State&, const std::string_view, const real);
7878
/*!
7979
* \brief set the value of a gradient
8080
* \param[out] s: state
8181
* \param[in] n: name
8282
* \param[in] v: values
8383
*/
84-
MGIS_EXPORT void setGradient(State&, const string_view, const real* const);
84+
MGIS_EXPORT void setGradient(State&, const std::string_view, const real* const);
8585
/*!
8686
* \brief set the value of a gradient
8787
* \param[out] s: state
@@ -117,14 +117,14 @@ namespace mgis::behaviour {
117117
* \param[in] s: state
118118
* \param[in] n: name
119119
*/
120-
MGIS_EXPORT real* getGradient(State&, const string_view);
120+
MGIS_EXPORT real* getGradient(State&, const std::string_view);
121121
/*!
122122
* \brief get the value(s) of a gradient
123123
* \return a pointer the value(s) of the gradient
124124
* \param[in] s: state
125125
* \param[in] n: name
126126
*/
127-
MGIS_EXPORT const real* getGradient(const State&, const string_view);
127+
MGIS_EXPORT const real* getGradient(const State&, const std::string_view);
128128
/*!
129129
* \brief get the value(s) of a gradient
130130
* \return a pointer the value(s) of the gradient
@@ -145,15 +145,15 @@ namespace mgis::behaviour {
145145
* \param[in] n: name
146146
* \param[in] v: value
147147
*/
148-
MGIS_EXPORT void setThermodynamicForce(State&, const string_view, const real);
148+
MGIS_EXPORT void setThermodynamicForce(State&, const std::string_view, const real);
149149
/*!
150150
* \brief set the value of a thermodynamic force
151151
* \param[out] s: state
152152
* \param[in] n: name
153153
* \param[in] v: values
154154
*/
155155
MGIS_EXPORT void setThermodynamicForce(State&,
156-
const string_view,
156+
const std::string_view,
157157
const real* const);
158158
/*!
159159
* \brief set the value of a thermodynamic force
@@ -190,15 +190,15 @@ namespace mgis::behaviour {
190190
* \param[in] s: state
191191
* \param[in] n: name
192192
*/
193-
MGIS_EXPORT real* getThermodynamicForce(State&, const string_view);
193+
MGIS_EXPORT real* getThermodynamicForce(State&, const std::string_view);
194194
/*!
195195
* \brief get the value(s) of a thermodynamic force
196196
* \return a pointer the value(s) of the thermodynamic force
197197
* \param[in] s: state
198198
* \param[in] n: name
199199
*/
200200
MGIS_EXPORT const real* getThermodynamicForce(const State&,
201-
const string_view);
201+
const std::string_view);
202202
/*!
203203
* \brief get the value(s) of a thermodynamic force
204204
* \return a pointer the value(s) of the thermodynamic force
@@ -219,19 +219,19 @@ namespace mgis::behaviour {
219219
* \param[in] n: name
220220
* \param[in] v: value
221221
*/
222-
MGIS_EXPORT void setMaterialProperty(State&, const string_view, const real);
222+
MGIS_EXPORT void setMaterialProperty(State&, const std::string_view, const real);
223223
/*!
224224
* \return a pointer to the value of a material property
225225
* \param[in] s: state
226226
* \param[in] n: name
227227
*/
228-
MGIS_EXPORT real* getMaterialProperty(State&, const string_view);
228+
MGIS_EXPORT real* getMaterialProperty(State&, const std::string_view);
229229
/*!
230230
* \return a pointer to the value of a material property
231231
* \param[in] s: state
232232
* \param[in] n: name
233233
*/
234-
MGIS_EXPORT const real* getMaterialProperty(const State&, const string_view);
234+
MGIS_EXPORT const real* getMaterialProperty(const State&, const std::string_view);
235235
/*!
236236
* \brief set the value of a material property
237237
* \param[out] s: state
@@ -258,7 +258,7 @@ namespace mgis::behaviour {
258258
* \param[in] v: value
259259
*/
260260
MGIS_EXPORT void setInternalStateVariable(State&,
261-
const string_view,
261+
const std::string_view,
262262
const real);
263263
/*!
264264
* \brief set the value of an internal state variable
@@ -267,7 +267,7 @@ namespace mgis::behaviour {
267267
* \param[in] v: values
268268
*/
269269
MGIS_EXPORT void setInternalStateVariable(State&,
270-
const string_view,
270+
const std::string_view,
271271
const real* const);
272272
/*!
273273
* \brief set the value of an internal state variable
@@ -306,15 +306,15 @@ namespace mgis::behaviour {
306306
* \param[in] s: state
307307
* \param[in] n: name
308308
*/
309-
MGIS_EXPORT real* getInternalStateVariable(State&, const string_view);
309+
MGIS_EXPORT real* getInternalStateVariable(State&, const std::string_view);
310310
/*!
311311
* \brief get the value(s) of an internal state variable
312312
* \return a pointer the value(s) of the internal state variable
313313
* \param[in] s: state
314314
* \param[in] n: name
315315
*/
316316
MGIS_EXPORT const real* getInternalStateVariable(const State&,
317-
const string_view);
317+
const std::string_view);
318318
/*!
319319
* \brief get the value(s) of an internal state variable
320320
* \return a pointer the value(s) of the internal state variable
@@ -337,7 +337,7 @@ namespace mgis::behaviour {
337337
* \param[in] v: value
338338
*/
339339
MGIS_EXPORT void setExternalStateVariable(State&,
340-
const string_view,
340+
const std::string_view,
341341
const real);
342342
/*!
343343
* \brief set the value of an external state variable
@@ -346,7 +346,7 @@ namespace mgis::behaviour {
346346
* \param[in] v: value
347347
*/
348348
MGIS_EXPORT void setExternalStateVariable(State&,
349-
const string_view,
349+
const std::string_view,
350350
const mgis::span<const real>);
351351
/*!
352352
* \brief set the value of a scalar external state variable
@@ -371,14 +371,14 @@ namespace mgis::behaviour {
371371
* \param[out] s: state
372372
* \param[in] n: name
373373
*/
374-
MGIS_EXPORT real* getExternalStateVariable(State&, const string_view);
374+
MGIS_EXPORT real* getExternalStateVariable(State&, const std::string_view);
375375
/*!
376376
* \brief set the value of an external state variable
377377
* \param[out] s: state
378378
* \param[in] n: name
379379
*/
380380
MGIS_EXPORT const real* getExternalStateVariable(const State&,
381-
const string_view);
381+
const std::string_view);
382382
/*!
383383
* \return a pointer to the value of an external state variable
384384
* \param[out] s: state

include/MGIS/Behaviour/Variable.hxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
#include <string>
1919
#include <vector>
20+
#include <string_view>
2021
#include "MGIS/Config.hxx"
21-
#include "MGIS/StringView.hxx"
2222
#include "MGIS/Behaviour/Hypothesis.hxx"
2323

2424
namespace mgis::behaviour {
@@ -57,14 +57,14 @@ namespace mgis::behaviour {
5757
* \param[in] vs: variables
5858
* \param[in] n: name
5959
*/
60-
MGIS_EXPORT bool contains(const std::vector<Variable> &, const string_view);
60+
MGIS_EXPORT bool contains(const std::vector<Variable> &, const std::string_view);
6161
/*!
6262
* \return the variable with the given name
6363
* \param[in] vs: variables
6464
* \param[in] n: name
6565
*/
6666
MGIS_EXPORT const Variable &getVariable(const std::vector<Variable> &,
67-
const string_view);
67+
const std::string_view);
6868
/*!
6969
* \return the type of a variable from an identifier
7070
* \param[in] id: type identifier
@@ -96,7 +96,7 @@ namespace mgis::behaviour {
9696
* \param[in] h: modelling hypothesis
9797
*/
9898
MGIS_EXPORT size_type getVariableOffset(const std::vector<Variable> &,
99-
const string_view,
99+
const std::string_view,
100100
const Hypothesis);
101101
/*!
102102
* \return the type of the given variable as a string

0 commit comments

Comments
 (0)