MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / check_material_parameters

Function check_material_parameters

tools/Assembler/Materials/OrthotropicMaterial.h:13–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12namespace OrthotropicMaterialHelper {
13 void check_material_parameters(size_t dim, const VectorF& young_modulus,
14 const VectorF& poisson_ratio, const VectorF& shear_modulus) {
15 if (dim != 2 && dim != 3) {
16 throw NotImplementedError("Only 2D and 3D materials are supported");
17 }
18 if (dim != young_modulus.size()) {
19 throw RuntimeError("Wrong dimention for young's modulus");
20 }
21 if (dim*(dim-1)/2 != shear_modulus.size()) {
22 throw RuntimeError("Wrong dimention for shear modulus");
23 }
24 if (young_modulus.minCoeff() < 0.0) {
25 throw RuntimeError("Young's modulus must be positive!");
26 }
27 if (shear_modulus.minCoeff() < 0.0) {
28 throw RuntimeError("Shear modulus must be positive!");
29 }
30 }
31
32 bool is_symmetric(const MatrixF& M) {
33 const Float TOL = 1e-6;

Callers 2

OrthotropicMaterialMethod · 0.85
OrthotropicMaterialMethod · 0.85

Calls 3

NotImplementedErrorClass · 0.85
RuntimeErrorClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected