3 #include <funcy/examples/volumetric_penalty_functions.h> 4 #include <funcy/funcy.h> 23 template < linalg::Matrix Mat,
int n = linalg::dim< Mat >() >
26 using namespace linalg;
27 auto S = LeftCauchyGreenStrainTensor( F );
28 auto f = ( c0 * (
i1( F ) - n ) + c1 * (
i2( F ) - n ) );
38 template <
class InflationPenalty,
class CompressionPenalty,
linalg::Matrix Mat,
39 int n = linalg::dim< Mat >() >
42 using namespace linalg;
43 auto S = LeftCauchyGreenStrainTensor( F );
44 auto f = ( c0 * (
i1( F ) - n ) + c1 * (
i2( F ) - n ) );
46 volumetric_penalty< InflationPenalty, CompressionPenalty >( d0, d1, F ) );
63 template < linalg::Matrix Mat,
class InflationPenalty,
class CompressionPenalty >
69 auto rho = g.d1( I ) / ( -g.d2( I, I ) + g.d1( I ) );
70 auto d = ( lambda + 2.0 * mu ) / ( g.d2( I, I ) - g.d1( I ) );
71 auto c = ( 0.5 * rho - 0.25 ) * mu + 0.25 * rho * lambda;
73 c = ( rho - 0.75 ) * mu + 0.5 * rho * lambda;
74 auto b = -mu + rho * ( lambda + 2. * mu ) - 2. * c;
76 auto alpha = 0.5 * a - b;
79 if ( a < 0 || b < 0 || c < 0 )
81 std::cout <<
"In the generation of Mooney-Rivlin material model from Lame constants." 83 std::cout <<
"Computed parameters: " << alpha <<
", " << beta <<
", " << c <<
", " << d
85 std::cout <<
"Material law is not polyconvex! -> Terminating." << std::endl;
89 return compressible_mooney_rivlin< InflationPenalty, CompressionPenalty >(
90 alpha, beta, c, d, linalg::unit_matrix< Mat >() );
107 template < linalg::Matrix Mat,
class InflationPenalty,
class CompressionPenalty >
110 double lambda = E * nu / ( ( 1 + nu ) * ( 1 - 2 * nu ) );
111 double mu = E / ( 2 * ( 1 + nu ) );
113 CompressionPenalty >( lambda, mu );
auto incompressible_mooney_rivlin(double c0, double c1, const Mat &F)
Generate an "incompressible" Mooney-Rivlin material law , where is the first and the second princip...
Definition: mooney_rivlin.h:24
concept Matrix
clang-format off
Definition: concepts.h:63
auto compressible_mooney_rivlin(double c0, double c1, double d0, double d1, const Mat &F)
Generate a compressible Mooney-Rivlin material law , where is the first and the second principal ma...
Definition: mooney_rivlin.h:40
Main namespace of the funcy library.
Identity mapping .
Definition: identity.h:12
auto create_mooney_rivlin_from_material_constants(double E, double nu)
Generate a compressible Mooney-Rivlin material law , where is the first and the second principal ma...
Definition: mooney_rivlin.h:108
auto finalize(F &&f) requires(static_check
Finish function definition.
Definition: finalize.h:248
auto i2(M &&A)
Convenient generation of second principal invariant for .
Definition: principal_invariants.h:162
auto i1(Arg &&x)
Generate first principal invariant.
Definition: principal_invariants.h:151
auto create_mooney_rivlin_from_lame_constants(double lambda, double mu)
Generate a compressible Mooney-Rivlin material law , where is the first and the second principal ma...
Definition: mooney_rivlin.h:64