funcy  1.6.0
neo_hooke.h
1 #pragma once
2 
3 #include <funcy/examples/volumetric_penalty_functions.h>
4 #include <funcy/funcy.h>
5 
12 namespace funcy
13 {
19  template < linalg::Matrix M, int n = linalg::dim< M >() >
20  auto incompressible_neo_hooke( double c, const M& F )
21  {
22  using namespace linalg;
23  auto S = strain_tensor( F );
24  auto x = i1( S );
25  return finalize( c * ( x - n ) );
26  }
27 
33  template < linalg::Matrix M, int n = linalg::dim< M >() >
34  auto modified_incompressible_neo_hooke( double c, const M& F )
35  {
36  using namespace linalg;
37  auto S = LeftCauchyGreenStrainTensor( F );
38  return finalize( c * ( mi1< decltype( S ), n >( S ) - n ) );
39  }
40 
47  template < class InflationPenalty, class CompressionPenalty, linalg::Matrix M,
48  int n = linalg::dim< M >() >
49  auto compressible_neo_hooke( double c, double d0, double d1, const M& F )
50  {
51  using namespace linalg;
52  return finalize( c * ( i1( strain_tensor( F ) ) - n ) +
53  volumetric_penalty< InflationPenalty, CompressionPenalty >( d0, d1, F ) );
54  }
55 
62  template < class InflationPenalty, class CompressionPenalty, linalg::Matrix M,
63  int n = linalg::dim< M >() >
64  auto modified_compressible_neo_hooke( double c, double d0, double d1, const M& F )
65  {
66  using namespace linalg;
67  auto S = LeftCauchyGreenStrainTensor< M >( F );
68  return finalize( c * ( mi1< decltype( S ), n >( S ) - n ) +
69  volumetric_penalty< InflationPenalty, CompressionPenalty >( d0, d1, F ) );
70  }
71 } // namespace funcy
auto compressible_neo_hooke(double c, double d0, double d1, const M &F)
Generate a compressible neo-Hookean material law , where is the first principal matrix invariant...
Definition: neo_hooke.h:49
auto modified_compressible_neo_hooke(double c, double d0, double d1, const M &F)
Generate a compressible neo-Hookean material law , where is the modified first principal matrix inva...
Definition: neo_hooke.h:64
auto mi1(const Arg &x)
Isochoric (volume-preserving), first modified principal invariant , where is the first and is the t...
Definition: principal_invariants.h:204
concept Matrix
Matrix concept.
Definition: concepts.h:77
auto incompressible_neo_hooke(double c, const M &F)
Generate an "incompressible" neo-Hookean material law , where is the first principal matrix invarian...
Definition: neo_hooke.h:20
Main namespace of the funcy library.
auto finalize(F &&f) requires(static_check
Finish function definition.
Definition: finalize.h:248
auto strain_tensor(const Mat &A)
Generate the right Cauchy-Green strain tensor .
Definition: strain_tensor.h:123
auto modified_incompressible_neo_hooke(double c, const M &F)
Generate an "incompressible" neo-Hookean material law , where is the modified first principal matrix...
Definition: neo_hooke.h:34
auto i1(Arg &&x)
Generate first principal invariant.
Definition: principal_invariants.h:155