Skip to content

Commit b138d9b

Browse files
Thomas HELFERThomas HELFER
Thomas HELFER
authored and
Thomas HELFER
committed
Fix Issue thelfer#33. Add configuration file for clang-format
1 parent 46cd4da commit b138d9b

File tree

4 files changed

+38
-5
lines changed

4 files changed

+38
-5
lines changed

.clang-format

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Language: Cpp
2+
Standard: Cpp11
3+
BasedOnStyle: Google
4+
ColumnLimit: 80
5+
Cpp11BracedListStyle: true
6+
BinPackParameters: false
7+
NamespaceIndentation: All
8+
SortIncludes: false

bindings/python/src/Behaviour.cxx

+7
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,13 @@ void declareBehaviour() {
300300
.def("getLowerPhysicalBound ", getLowerPhysicalBound)
301301
.def("getUpperPhysicalBound ", getUpperPhysicalBound);
302302
// wrapping free functions
303+
boost::python::def(
304+
"isStandardFiniteStrainBehaviour",
305+
mgis::behaviour::isStandardFiniteStrainBehaviour,
306+
"return if the given behaviour is a standard finite strain behaviour, "
307+
"i.e. is a finite strain behaviour using the standard finite strain "
308+
"kinematic (called F-Cauchy although the stress measure can be chosen "
309+
"when loading the behaviour)");
303310
boost::python::def("load", load_ptr);
304311
boost::python::def("load", load_ptr2);
305312
boost::python::def("setParameter", setParameter1);

include/MGIS/Behaviour/Behaviour.hxx

+16-5
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,20 @@ namespace mgis {
150150
* stress with respect to the deformation gradient is returned
151151
*/
152152
std::vector<mgis::real> options;
153-
}; // end of struct Behaviour
153+
}; // end of struct Behaviour
154+
155+
/*!
156+
* \return if the given behaviour is a standard finite strain behaviour,
157+
* i.e. is a finite strain behaviour using the standard finite strain kinematic
158+
* (called F-Cauchy although the stress measure can be chosen when
159+
* loading the behaviour)
160+
* \param[in] l: library name
161+
* \param[in] b: behaviour name
162+
* \note: use of `std::string` rather than `mgis::string_view` is
163+
* meaningfull here
164+
*/
165+
MGIS_EXPORT bool isStandardFiniteStrainBehaviour(const std::string &,
166+
const std::string &);
154167

155168
/*!
156169
* \brief load the description of a behaviour from a library
@@ -162,8 +175,7 @@ namespace mgis {
162175
* \note: use of `std::string` rather than `mgis::string_view` is
163176
* meaningfull here
164177
*/
165-
MGIS_EXPORT Behaviour load(const std::string &,
166-
const std::string &,
178+
MGIS_EXPORT Behaviour load(const std::string &, const std::string &,
167179
const Hypothesis);
168180
/*!
169181
* \brief load the description of a finite strain behaviour from a library
@@ -182,8 +194,7 @@ namespace mgis {
182194
* meaningfull here
183195
*/
184196
MGIS_EXPORT Behaviour load(const FiniteStrainBehaviourOptions &,
185-
const std::string &,
186-
const std::string &,
197+
const std::string &, const std::string &,
187198
const Hypothesis);
188199
/*!
189200
* \return the size of an array able to contain all the values of the

src/Behaviour.cxx

+7
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ namespace mgis {
132132
Behaviour &Behaviour::operator=(const Behaviour &) = default;
133133
Behaviour::~Behaviour() = default;
134134

135+
bool isStandardFiniteStrainBehaviour(const std::string &l,
136+
const std::string &b) {
137+
auto &lm = mgis::LibrariesManager::get();
138+
return (lm.getBehaviourType(l, b) == 2) &&
139+
(lm.getBehaviourKinematic(l, b) == 3);
140+
} // end of isStandardFiniteStrainBehaviour
141+
135142
Behaviour load(const std::string &l,
136143
const std::string &b,
137144
const Hypothesis h) {

0 commit comments

Comments
 (0)