| 11 | |
| 12 | namespace 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; |
no test coverage detected