Skip to content

Commit 21466c1

Browse files
committed
Fix Issue #140
1 parent ec5d81e commit 21466c1

16 files changed

Lines changed: 97 additions & 1341 deletions

bindings/python/src/BehaviourDescription.cxx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,16 @@ static const char *BehaviourDescription_getType(
2929
switch (b.btype) {
3030
case BehaviourDescription::GENERALBEHAVIOUR:
3131
return "GeneralBehaviour";
32-
break;
3332
case BehaviourDescription::STANDARDSTRAINBASEDBEHAVIOUR:
3433
return "StandardStrainBasedBehaviour";
35-
break;
3634
case BehaviourDescription::STANDARDFINITESTRAINBEHAVIOUR:
3735
return "StandardFiniteStrainBehaviour";
38-
break;
3936
case BehaviourDescription::COHESIVEZONEMODEL:
4037
return "CohesiveZoneModel";
41-
break;
4238
default:
43-
mgis::raise("BehaviourDescription_getType: unsupported behaviour type");
39+
break;
4440
}
45-
return "";
41+
mgis::raise("BehaviourDescription_getType: unsupported behaviour type");
4642
} // end of BehaviourDescription_getType
4743

4844
static const char *BehaviourDescription_getKinematic(
@@ -51,16 +47,12 @@ static const char *BehaviourDescription_getKinematic(
5147
switch (b.kinematic) {
5248
case BehaviourDescription::SMALLSTRAINKINEMATIC:
5349
return "SmallStrainKinematic";
54-
break;
5550
case BehaviourDescription::COHESIVEZONEKINEMATIC:
5651
return "CohesiveZoneKinematic";
57-
break;
5852
case BehaviourDescription::FINITESTRAINKINEMATIC_F_CAUCHY:
5953
return "F_CAUCHY";
60-
break;
6154
case BehaviourDescription::FINITESTRAINKINEMATIC_ETO_PK1:
6255
return "ETO_PK1";
63-
break;
6456
case BehaviourDescription::UNDEFINEDKINEMATIC:
6557
default:
6658
break;
@@ -77,10 +69,9 @@ static const char *BehaviourDescription_getSymmetry(
7769
case BehaviourDescription::ORTHOTROPIC:
7870
return "Orthotropic";
7971
default:
80-
mgis::raise("unsupported symmetry type");
8172
break;
8273
}
83-
return "UndefinedSymemtry";
74+
mgis::raise("unsupported symmetry type");
8475
} // end of BehaviourDescription_getSymmetry
8576

8677
static std::vector<mgis::behaviour::Variable> BehaviourDescription_getGradients(

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/State.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ void declareState() {
8888
State_setExternalStateVariable2,
8989
"set the value of an external state variable by offset");
9090

91-
} // end of declareState
91+
} // end of declareState

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

cmake/modules/clang.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ else(enable-fast-math)
2020
tfel_enable_cxx_compiler_flag(OPTIMISATION_FLAGS2 "ffast-math")
2121
endif(enable-fast-math)
2222

23-
tfel_enable_cxx_compiler_flag(VISIBILITY_FLAGS "fvisibility=hidden")
24-
tfel_enable_cxx_compiler_flag(VISIBILITY_FLAGS "fvisibility-inlines-hidden")
25-
set(COMPILER_DEFAULT_VISIBILITY_FLAG "-fvisibility=default")
23+
if(NOT WIN32)
24+
tfel_enable_cxx_compiler_flag(VISIBILITY_FLAGS "fvisibility=hidden")
25+
tfel_enable_cxx_compiler_flag(VISIBILITY_FLAGS "fvisibility-inlines-hidden")
26+
set(COMPILER_DEFAULT_VISIBILITY_FLAG "-fvisibility=default")
27+
endif(NOT WIN32)
2628

2729
set(OPTIMISATION_FLAGS "-DNO_RUNTIME_CHECK_BOUNDS ${OPTIMISATION_FLAGS}")
2830

@@ -36,7 +38,11 @@ endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
3638

3739
if(HAVE_FORTRAN)
3840
# we associate clang with the gnu fortran compiler
39-
include(cmake/modules/gnu-fortran-compiler.cmake)
41+
if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "IntelLLVM")
42+
set(INTEL_FORTRAN_COMPILER ON)
43+
else()
44+
include(cmake/modules/gnu-fortran-compiler.cmake)
45+
endif()
4046
endif(HAVE_FORTRAN)
4147

4248
option(enable-libcxx "use LLVM C++ Standard library" OFF)

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: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
#include <vector>
2121
#include <variant>
2222
#include <optional>
23+
#include <string_view>
2324
#include "MGIS/Config.hxx"
2425
#include "MGIS/Span.hxx"
2526
#include "MGIS/StorageMode.hxx"
26-
#include "MGIS/StringView.hxx"
2727

2828
namespace mgis::behaviour {
2929

@@ -200,7 +200,7 @@ namespace mgis::behaviour {
200200
* \param[in] v: value
201201
*/
202202
MGIS_EXPORT void setMaterialProperty(MaterialStateManager&,
203-
const mgis::string_view&,
203+
const std::string_view&,
204204
const real);
205205
/*!
206206
* \brief set the given material property
@@ -210,7 +210,7 @@ namespace mgis::behaviour {
210210
* \param[in] s: storage mode
211211
*/
212212
MGIS_EXPORT void setMaterialProperty(MaterialStateManager&,
213-
const mgis::string_view&,
213+
const std::string_view&,
214214
const mgis::span<mgis::real>&,
215215
const MaterialStateManager::StorageMode =
216216
MaterialStateManager::LOCAL_STORAGE);
@@ -222,14 +222,14 @@ namespace mgis::behaviour {
222222
* \param[in] s: storage mode
223223
*/
224224
MGIS_EXPORT bool isMaterialPropertyDefined(const MaterialStateManager&,
225-
const mgis::string_view&);
225+
const std::string_view&);
226226
/*!
227227
* \brief chek if the given material property is uniform
228228
* \param[out] m: material data manager
229229
* \param[in] n: name
230230
*/
231231
MGIS_EXPORT bool isMaterialPropertyUniform(const MaterialStateManager&,
232-
const mgis::string_view&);
232+
const std::string_view&);
233233
/*!
234234
* \brief set the mass density
235235
* \param[out] m: material data manager
@@ -263,7 +263,7 @@ namespace mgis::behaviour {
263263
* \param[in] v: value
264264
*/
265265
MGIS_EXPORT void setExternalStateVariable(MaterialStateManager&,
266-
const mgis::string_view&,
266+
const std::string_view&,
267267
const real);
268268
/*!
269269
* \brief set the given external state variable
@@ -274,7 +274,7 @@ namespace mgis::behaviour {
274274
*/
275275
MGIS_EXPORT void setExternalStateVariable(
276276
MaterialStateManager&,
277-
const mgis::string_view&,
277+
const std::string_view&,
278278
const mgis::span<mgis::real>&,
279279
const MaterialStateManager::StorageMode =
280280
MaterialStateManager::LOCAL_STORAGE);
@@ -286,14 +286,14 @@ namespace mgis::behaviour {
286286
* \param[in] s: storage mode
287287
*/
288288
MGIS_EXPORT bool isExternalStateVariableDefined(const MaterialStateManager&,
289-
const mgis::string_view&);
289+
const std::string_view&);
290290
/*!
291291
* \return true if the given external state variable is uniform.
292292
* \param[out] m: material data manager
293293
* \param[in] n: name
294294
*/
295295
MGIS_EXPORT bool isExternalStateVariableUniform(const MaterialStateManager&,
296-
const mgis::string_view&);
296+
const std::string_view&);
297297
/*!
298298
* \brief update the values of a state from another state
299299
* \param[out] o: output state
@@ -314,7 +314,7 @@ namespace mgis::behaviour {
314314
MGIS_EXPORT void extractInternalStateVariable(
315315
mgis::span<mgis::real>,
316316
const mgis::behaviour::MaterialStateManager&,
317-
const mgis::string_view);
317+
const std::string_view);
318318

319319
} // end of namespace mgis::behaviour
320320

0 commit comments

Comments
 (0)