funcy  1.6.0
adipose_tissue_sommer_holzapfel.h
1 #pragma once
2 
3 #include <funcy/examples/volumetric_penalty_functions.h>
4 #include <funcy/funcy.h>
5 
12 namespace funcy
13 {
15  namespace detail
16  {
17  template < linalg::Matrix Mat, int n = linalg::dim< Mat >() >
18  auto generate_incompressible_adipose_tissue_sommer_holzapfel( double cCells, double k1,
19  double k2, double kappa,
20  const Mat& A, const Mat& F )
21  {
22  using namespace linalg;
23  auto S = LeftCauchyGreenStrainTensor( F );
24 
25  auto aniso = kappa * i1( F ) + ( 1 - 3 * kappa ) * i4( F, A ) - 1;
26  auto f = cCells * ( i1( F ) - n ) + ( k1 / k2 ) * ( exp( k2 * squared( aniso ) ) - 1 );
27  return f( S );
28  }
29  } // namespace detail
31 
54  template < linalg::Matrix Mat, int offset = linalg::dim< Mat >() >
55  auto incompressible_adipose_tissue_sommer_holzapfel( double cCells, double k1, double k2,
56  double kappa, const Mat& A, const Mat& F )
57  {
58  return finalize(
59  detail::generate_incompressible_adipose_tissue_sommer_holzapfel< Mat, offset >(
60  cCells, k1, k2, kappa, A, F ) );
61  }
62 
79  template < linalg::Matrix Mat, int offset = linalg::dim< Mat >() >
80  auto incompressible_adipose_tissue_sommer_holzapfel( const Mat& A, const Mat& F )
81  {
82  return incompressible_adipose_tissue_sommer_holzapfel< Mat, offset >( 0.15, 0.8, 47.3, 0.09,
83  A, F );
84  }
85 
106  template < class Inflation, class Compression, linalg::Matrix Mat,
107  int offset = linalg::dim< Mat >() >
108  auto compressible_adipose_tissue_sommer_holzapfel( double cCells, double k1, double k2,
109  double kappa, double d0, double d1,
110  const Mat& M, const Mat& F )
111  {
112  return finalize(
113  detail::generate_incompressible_adipose_tissue_sommer_holzapfel< Mat, offset >(
114  cCells, k1, k2, kappa, M, F ) +
115  volumetric_penalty< Inflation, Compression >( d0, d1, F ) );
116  }
117 
136  template < class Inflation, class Compression, linalg::Matrix Mat,
137  int offset = linalg::dim< Mat >() >
138  auto compressible_adipose_tissue_sommer_holzapfel( double d0, double d1, const Mat& M,
139  const Mat& F )
140  {
141  return compressible_adipose_tissue_sommer_holzapfel< Inflation, Compression, Mat, offset >(
142  0.15, 0.8, 47.3, 0.09, d0, d1, M, F );
143  }
145 } // namespace funcy
concept Matrix
Matrix concept.
Definition: concepts.h:77
auto exp(const F &f)
Generate .
Definition: exp.h:117
Main namespace of the funcy library.
auto finalize(F &&f) requires(static_check
Finish function definition.
Definition: finalize.h:248
auto i4(const Mat &A, const Mat &M) requires(!Function< Mat >)
Generate first mixed invariant of a matrix with respect to the structural tensor ...
Definition: mixed_invariants.h:26
auto i1(Arg &&x)
Generate first principal invariant.
Definition: principal_invariants.h:155
auto squared(F &&f)
Generate squared function.
Definition: generate.h:153
auto compressible_adipose_tissue_sommer_holzapfel(double cCells, double k1, double k2, double kappa, double d0, double d1, const Mat &M, const Mat &F)
Compressible version of the model for adipose tissue of .
Definition: adipose_tissue_sommer_holzapfel.h:108
auto incompressible_adipose_tissue_sommer_holzapfel(double cCells, double k1, double k2, double kappa, const Mat &A, const Mat &F)
Model for adipose tissue of .
Definition: adipose_tissue_sommer_holzapfel.h:55