MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
constltp.h File Reference
#include "withlab.h"
#include "simentity.h"
#include "tpldrive.h"
Include dependency graph for constltp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ConstLawType
 
class  ConstitutiveLaw< T, Tder >
 
class  ConstitutiveLaw< T, Tder >::ErrNotAvailable
 
class  ConstitutiveLawOwner< T, Tder >
 
struct  ConstitutiveLawRead< T, Tder >
 

Typedefs

typedef ConstitutiveLaw
< doublereal, doublereal
ConstitutiveLaw1D
 
typedef ConstitutiveLaw< Vec3,
Mat3x3
ConstitutiveLaw3D
 
typedef ConstitutiveLaw< Vec6,
Mat6x6
ConstitutiveLaw6D
 
typedef ConstitutiveLawOwner
< doublereal, doublereal
ConstitutiveLaw1DOwner
 
typedef ConstitutiveLawOwner
< Vec3, Mat3x3
ConstitutiveLaw3DOwner
 
typedef ConstitutiveLawOwner
< Vec6, Mat6x6
ConstitutiveLaw6DOwner
 

Functions

ConstitutiveLaw< doublereal,
doublereal > * 
ReadCL1D (const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
 
ConstitutiveLaw< Vec3, Mat3x3 > * ReadCL3D (const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
 
ConstitutiveLaw< Vec6, Mat6x6 > * ReadCL6D (const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
 
bool SetCL1D (const char *name, ConstitutiveLawRead< doublereal, doublereal > *rf)
 
bool SetCL3D (const char *name, ConstitutiveLawRead< Vec3, Mat3x3 > *rf)
 
bool SetCL6D (const char *name, ConstitutiveLawRead< Vec6, Mat6x6 > *rf)
 
void InitCL (void)
 
void DestroyCL (void)
 

Typedef Documentation

Definition at line 183 of file constltp.h.

Definition at line 184 of file constltp.h.

Definition at line 379 of file constltp.h.

Definition at line 185 of file constltp.h.

Definition at line 380 of file constltp.h.

Function Documentation

void DestroyCL ( void  )

Definition at line 1549 of file constltp_impl.cc.

References CL1DFuncMap, CL3DFuncMap, CL6DFuncMap, done, and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::~MBDynParser().

1550 {
1551  if (::done == 0) {
1552  silent_cerr("DestroyCL() called once too many" << std::endl);
1554  }
1555 
1556  if (--::done > 0) {
1557  return;
1558  }
1559 
1560  /* free stuff */
1561  for (CL1DFuncMapType::iterator i = CL1DFuncMap.begin(); i != CL1DFuncMap.end(); ++i) {
1562  delete i->second;
1563  }
1564  CL1DFuncMap.clear();
1565 
1566  for (CL3DFuncMapType::iterator i = CL3DFuncMap.begin(); i != CL3DFuncMap.end(); ++i) {
1567  delete i->second;
1568  }
1569  CL3DFuncMap.clear();
1570 
1571  for (CL6DFuncMapType::iterator i = CL6DFuncMap.begin(); i != CL6DFuncMap.end(); ++i) {
1572  delete i->second;
1573  }
1574  CL6DFuncMap.clear();
1575 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
static CL3DFuncMapType CL3DFuncMap
static CL6DFuncMapType CL6DFuncMap
static unsigned done
static CL1DFuncMapType CL1DFuncMap
void InitCL ( void  )

Definition at line 1389 of file constltp_impl.cc.

References done, NLP_init(), NLSF_init(), SetCL1D(), SetCL3D(), SetCL6D(), and TDCLW_init().

Referenced by MBDynParser::MBDynParser().

1390 {
1391  if (::done++ > 0) {
1392  return;
1393  }
1394 
1395  /* constitutive law array */
1396  SetCL1D("array", new CLArray1DR);
1397  SetCL3D("array", new CLArray3DR);
1398  SetCL6D("array", new CLArray6DR);
1399 
1400  /* linear elastic */
1401  SetCL1D("linear" "elastic", new LinearElasticCLR<doublereal, doublereal>);
1402  SetCL3D("linear" "elastic", new LinearElasticCLR<Vec3, Mat3x3>);
1403  SetCL6D("linear" "elastic", new LinearElasticCLR<Vec6, Mat6x6>);
1404 
1405  /* linear elastic isotropic */
1406  SetCL1D("linear" "elastic" "isotropic", new LinearElasticCLR<doublereal, doublereal>);
1407  SetCL3D("linear" "elastic" "isotropic", new LinearElasticCLR<Vec3, Mat3x3>);
1408  SetCL6D("linear" "elastic" "isotropic", new LinearElasticCLR<Vec6, Mat6x6>);
1409 
1410  /* linear elastic generic */
1411  SetCL1D("linear" "elastic" "generic", new LinearElasticGenericCLR<doublereal, doublereal>);
1412  SetCL3D("linear" "elastic" "generic", new LinearElasticGenericCLR<Vec3, Mat3x3>);
1413  SetCL6D("linear" "elastic" "generic", new LinearElasticGenericCLR<Vec6, Mat6x6>);
1414 
1415  /* linear (visco)elastic generic axial torsion coupling*/
1416  SetCL6D("linear" "elastic" "generic" "axial" "torsion" "coupling",
1418  SetCL6D("linear" "viscoelastic" "generic" "axial" "torsion" "coupling",
1420 
1421  /* inverse square elastic */
1422  SetCL1D("inverse" "square" "elastic", new InverseSquareElasticCLR);
1423 
1424  /* log elastic */
1425  SetCL1D("log" "elastic", new LogElasticCLR<doublereal, doublereal>);
1426 
1427  /* double linear elastic */
1428  SetCL1D("double" "linear" "elastic", new DoubleLinearElasticCLR<doublereal, doublereal>);
1429  SetCL3D("double" "linear" "elastic", new DoubleLinearElasticCLR<Vec3, Mat3x3>);
1430 
1431  /* isotropic hardening elastic */
1432  SetCL1D("isotropic" "hardening" "elastic", new IsotropicHardeningCLR<doublereal, doublereal>);
1433  SetCL3D("isotropic" "hardening" "elastic", new IsotropicHardeningCLR<Vec3, Mat3x3>);
1434  SetCL6D("isotropic" "hardening" "elastic", new IsotropicHardeningCLR<Vec6, Mat6x6>);
1435 
1436  /* contact elastic */
1437  SetCL1D("contact" "elastic", new ContactElasticCLR<doublereal, doublereal>);
1438  SetCL3D("contact" "elastic", new ContactElasticCLR<Vec3, Mat3x3>);
1439 
1440  /* symbolic (elastic, viscous, viscoelastic) */
1442  SetCL3D("symbolic", new SymbolicCLR<Vec3, Mat3x3>);
1443  SetCL6D("symbolic", new SymbolicCLR<Vec6, Mat6x6>);
1444 
1445  SetCL1D("symbolic" "elastic", new SymbolicElasticCLR<doublereal, doublereal>);
1446  SetCL3D("symbolic" "elastic", new SymbolicElasticCLR<Vec3, Mat3x3>);
1447  SetCL6D("symbolic" "elastic", new SymbolicElasticCLR<Vec6, Mat6x6>);
1448 
1449  SetCL1D("symbolic" "viscous", new SymbolicViscousCLR<doublereal, doublereal>);
1450  SetCL3D("symbolic" "viscous", new SymbolicViscousCLR<Vec3, Mat3x3>);
1451  SetCL6D("symbolic" "viscous", new SymbolicViscousCLR<Vec6, Mat6x6>);
1452 
1453  SetCL1D("symbolic" "viscoelastic", new SymbolicViscoElasticCLR<doublereal, doublereal>);
1454  SetCL3D("symbolic" "viscoelastic", new SymbolicViscoElasticCLR<Vec3, Mat3x3>);
1455  SetCL6D("symbolic" "viscoelastic", new SymbolicViscoElasticCLR<Vec6, Mat6x6>);
1456 
1457  /* linear viscous */
1458  SetCL1D("linear" "viscous", new LinearViscousCLR<doublereal, doublereal>);
1459  SetCL3D("linear" "viscous", new LinearViscousCLR<Vec3, Mat3x3>);
1460  SetCL6D("linear" "viscous", new LinearViscousCLR<Vec6, Mat6x6>);
1461 
1462  /* linear viscous isotropic */
1463  SetCL1D("linear" "viscous" "isotropic", new LinearViscousCLR<doublereal, doublereal>);
1464  SetCL3D("linear" "viscous" "isotropic", new LinearViscousCLR<Vec3, Mat3x3>);
1465  SetCL6D("linear" "viscous" "isotropic", new LinearViscousCLR<Vec6, Mat6x6>);
1466 
1467  /* linear viscous generic */
1468  SetCL1D("linear" "viscous" "generic", new LinearViscousGenericCLR<doublereal, doublereal>);
1469  SetCL3D("linear" "viscous" "generic", new LinearViscousGenericCLR<Vec3, Mat3x3>);
1470  SetCL6D("linear" "viscous" "generic", new LinearViscousGenericCLR<Vec6, Mat6x6>);
1471 
1472  /* linear viscoelastic */
1473  SetCL1D("linear" "viscoelastic", new LinearViscoElasticCLR<doublereal, doublereal>);
1474  SetCL3D("linear" "viscoelastic", new LinearViscoElasticCLR<Vec3, Mat3x3>);
1475  SetCL6D("linear" "viscoelastic", new LinearViscoElasticCLR<Vec6, Mat6x6>);
1476 
1477  /* linear viscoelastic isotropic */
1478  SetCL1D("linear" "viscoelastic" "isotropic", new LinearViscoElasticCLR<doublereal, doublereal>);
1479  SetCL3D("linear" "viscoelastic" "isotropic", new LinearViscoElasticCLR<Vec3, Mat3x3>);
1480  SetCL6D("linear" "viscoelastic" "isotropic", new LinearViscoElasticCLR<Vec6, Mat6x6>);
1481 
1482  /* linear viscoelastic generic */
1483  SetCL1D("linear" "viscoelastic" "generic", new LinearViscoElasticGenericCLR<doublereal, doublereal>);
1484  SetCL3D("linear" "viscoelastic" "generic", new LinearViscoElasticGenericCLR<Vec3, Mat3x3>);
1485  SetCL6D("linear" "viscoelastic" "generic", new LinearViscoElasticGenericCLR<Vec6, Mat6x6>);
1486 
1487  /* linear time variant viscoelastic generic */
1488  SetCL1D("linear" "time" "variant" "viscoelastic" "generic", new LTVViscoElasticGenericCLR<doublereal, doublereal>);
1489  SetCL3D("linear" "time" "variant" "viscoelastic" "generic", new LTVViscoElasticGenericCLR<Vec3, Mat3x3>);
1490  SetCL6D("linear" "time" "variant" "viscoelastic" "generic", new LTVViscoElasticGenericCLR<Vec6, Mat6x6>);
1491 
1492  /* cubic elastic generic */
1493  SetCL1D("cubic" "elastic" "generic", new CubicElasticGenericCLR<doublereal, doublereal>);
1494  SetCL3D("cubic" "elastic" "generic", new CubicElasticGenericCLR<Vec3, Mat3x3>);
1495 
1496  /* cubic viscoelastic generic */
1497  SetCL1D("cubic" "viscoelastic" "generic", new CubicViscoElasticGenericCLR<doublereal, doublereal>);
1498  SetCL3D("cubic" "viscoelastic" "generic", new CubicViscoElasticGenericCLR<Vec3, Mat3x3>);
1499 
1500  /* double linear viscoelastic */
1501  SetCL1D("double" "linear" "viscoelastic", new DoubleLinearViscoElasticCLR<doublereal, doublereal>);
1502  SetCL3D("double" "linear" "viscoelastic", new DoubleLinearViscoElasticCLR<Vec3, Mat3x3>);
1503 
1504  /* turbulent viscoelastic */
1505  SetCL1D("turbulent" "viscoelastic", new TurbulentViscoElasticCLR<doublereal, doublereal>);
1506 
1507  /* linear elastic bistop */
1508  SetCL1D("linear" "elastic" "bistop", new LinearElasticBiStopCLR<doublereal, doublereal>);
1509  SetCL3D("linear" "elastic" "bistop", new LinearElasticBiStopCLR<Vec3, Mat3x3>);
1510  SetCL6D("linear" "elastic" "bistop", new LinearElasticBiStopCLR<Vec6, Mat6x6>);
1511 
1512  /* linear viscoelastic bistop */
1513  SetCL1D("linear" "viscoelastic" "bistop", new LinearViscoElasticBiStopCLR<doublereal, doublereal>);
1514  SetCL3D("linear" "viscoelastic" "bistop", new LinearViscoElasticBiStopCLR<Vec3, Mat3x3>);
1515  SetCL6D("linear" "viscoelastic" "bistop", new LinearViscoElasticBiStopCLR<Vec6, Mat6x6>);
1516 
1517  /* bistop wrapper */
1518  SetCL1D("bistop", new BiStopCLW1DR);
1519  SetCL3D("bistop", new BiStopCLW3DR);
1520  SetCL6D("bistop", new BiStopCLW6DR);
1521 
1522  /* shock absorber */
1523  SetCL1D("shock" "absorber", new ShockAbsorberCLR<doublereal, doublereal>);
1524 
1525  /* Artificial Neural Network */
1526  SetCL1D("ann" "elastic", new AnnElasticCLR<doublereal, doublereal>);
1527  SetCL1D("ann" "viscoelastic", new AnnViscoElasticCLR<doublereal, doublereal>);
1528 
1529  /* constitutive laws sponsored by Hutchinson CdR */
1530  NLP_init();
1531  NLSF_init();
1532 
1533  /* invariant constitutive law */
1534  SetCL3D("invariant" "angular", new InvAngularCLR);
1535  SetCL3D("axial" "wrapper", new AxialCLR);
1536 
1537  /* ... */
1538  TDCLW_init();
1539 
1540  /* NOTE: add here initialization of new built-in constitutive laws;
1541  * alternative ways to register new custom constitutive laws are:
1542  * - call SetCL*D() from anywhere in the code
1543  * - write a module that calls SetCL*D() from inside a function
1544  * called module_init(), and load it using "module load".
1545  */
1546 }
bool SetCL3D(const char *name, ConstitutiveLawRead< Vec3, Mat3x3 > *rf)
void TDCLW_init(void)
Definition: tdclw.cc:236
bool SetCL6D(const char *name, ConstitutiveLawRead< Vec6, Mat6x6 > *rf)
bool SetCL1D(const char *name, ConstitutiveLawRead< doublereal, doublereal > *rf)
static unsigned done
int NLSF_init(void)
int NLP_init(void)

Here is the call graph for this function:

ConstitutiveLaw<doublereal, doublereal>* ReadCL1D ( const DataManager pDM,
MBDynParser HP,
ConstLawType::Type CLType 
)

Definition at line 118 of file constltp_impl.cc.

References CL1DFuncMap, func(), IncludeParser::GetLineData(), HighParser::IsWord(), and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::GetConstLaw1D(), CLArray1DR::Read(), and BiStopCLW1DR::Read().

119 {
120  const char *s, *sOrig = HP.IsWord(CL1DWordSet);
121  if (sOrig == 0) {
122  /* default to linear elastic? */
123  s = "linear" "elastic";
124  sOrig = "";
125 
126  } else {
127  s = sOrig;
128  }
129 
130  CL1DFuncMapType::iterator func = CL1DFuncMap.find(std::string(s));
131  if (func == CL1DFuncMap.end()) {
132  silent_cerr("unknown constitutive law 1D type "
133  "\"" << sOrig << "\" "
134  "at line " << HP.GetLineData() << std::endl);
136  }
137 
138  return func->second->Read(pDM, HP, CLType);
139 }
static CL1DWordSetType CL1DWordSet
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
static CL1DFuncMapType CL1DFuncMap
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

ConstitutiveLaw<Vec3, Mat3x3>* ReadCL3D ( const DataManager pDM,
MBDynParser HP,
ConstLawType::Type CLType 
)

Definition at line 142 of file constltp_impl.cc.

References CL3DFuncMap, func(), IncludeParser::GetLineData(), HighParser::IsWord(), and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::GetConstLaw3D(), CLArray3DR::Read(), and BiStopCLW3DR::Read().

143 {
144  const char *s, *sOrig = HP.IsWord(CL3DWordSet);
145  if (sOrig == 0) {
146 #if 0
147  s = "linear" "elastic";
148  sOrig = "";
149 #else
150  silent_cerr("unknown constitutive law 3D type "
151  "at line " << HP.GetLineData() << std::endl);
153 #endif
154 
155  } else {
156  s = sOrig;
157  }
158 
159  CL3DFuncMapType::iterator func = CL3DFuncMap.find(std::string(s));
160  if (func == CL3DFuncMap.end()) {
161  silent_cerr("unknown constitutive law 3D type "
162  "\"" << sOrig << "\" "
163  "at line " << HP.GetLineData() << std::endl);
165  }
166 
167  return func->second->Read(pDM, HP, CLType);
168 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
static CL3DFuncMapType CL3DFuncMap
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
static CL3DWordSetType CL3DWordSet
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

ConstitutiveLaw<Vec6, Mat6x6>* ReadCL6D ( const DataManager pDM,
MBDynParser HP,
ConstLawType::Type CLType 
)

Definition at line 171 of file constltp_impl.cc.

References CL6DFuncMap, func(), IncludeParser::GetLineData(), HighParser::IsWord(), and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::GetConstLaw6D(), CLArray6DR::Read(), and BiStopCLW6DR::Read().

172 {
173  const char *s, *sOrig = HP.IsWord(CL6DWordSet);
174  if (sOrig == 0) {
175 #if 0
176  s = "linear" "elastic";
177  sOrig = "";
178 #else
179  silent_cerr("unknown constitutive law 6D type "
180  "at line " << HP.GetLineData() << std::endl);
182 #endif
183 
184  } else {
185  s = sOrig;
186  }
187 
188  CL6DFuncMapType::iterator func = CL6DFuncMap.find(std::string(s));
189  if (func == CL6DFuncMap.end()) {
190  silent_cerr("unknown constitutive law 6D type "
191  "\"" << sOrig << "\" "
192  "at line " << HP.GetLineData() << std::endl);
194  }
195 
196  return func->second->Read(pDM, HP, CLType);
197 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
static CL6DFuncMapType CL6DFuncMap
static CL6DWordSetType CL6DWordSet
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

bool SetCL1D ( const char *  name,
ConstitutiveLawRead< doublereal, doublereal > *  rf 
)

Definition at line 93 of file constltp_impl.cc.

References CL1DFuncMap.

Referenced by InitCL(), InitSF(), mbdyn_octave_set(), module_init(), NLP_init(), NLSF_init(), and TDCLW_init().

94 {
95  pedantic_cout("registering constitutive law 1D \"" << name << "\""
96  << std::endl );
97  return CL1DFuncMap.insert(CL1DFuncMapType::value_type(name, rf)).second;
98 }
static CL1DFuncMapType CL1DFuncMap
bool SetCL3D ( const char *  name,
ConstitutiveLawRead< Vec3, Mat3x3 > *  rf 
)

Definition at line 101 of file constltp_impl.cc.

References CL3DFuncMap.

Referenced by InitCL(), InitSF(), mbdyn_octave_set(), module_init(), NLP_init(), NLSF_init(), and TDCLW_init().

102 {
103  pedantic_cout("registering constitutive law 3D \"" << name << "\""
104  << std::endl );
105  return CL3DFuncMap.insert(CL3DFuncMapType::value_type(name, rf)).second;
106 }
static CL3DFuncMapType CL3DFuncMap
bool SetCL6D ( const char *  name,
ConstitutiveLawRead< Vec6, Mat6x6 > *  rf 
)

Definition at line 109 of file constltp_impl.cc.

References CL6DFuncMap.

Referenced by InitCL(), InitSF(), mbdyn_octave_set(), module_init(), NLP_init(), NLSF_init(), and TDCLW_init().

110 {
111  pedantic_cout("registering constitutive law 6D \"" << name << "\""
112  << std::endl );
113  return CL6DFuncMap.insert(CL6DFuncMapType::value_type(name, rf)).second;
114 }
static CL6DFuncMapType CL6DFuncMap