Commit 04cf6043 authored by DIAZ Jerome's avatar DIAZ Jerome Committed by GILLES Sebastien

#20 Add storage matrix for local computation of the deformation gradient.

parent 4d939b3c
......@@ -78,7 +78,7 @@ namespace MoReFEM
LocalMatrix,
LocalVector
>,
public Crtp::LocalMatrixStorage<SecondPiolaKirchhoffStressTensor<HyperelasticityPolicyT, ViscoelasticityPolicyT, InternalVariablePolicyT>, 9ul>,
public Crtp::LocalMatrixStorage<SecondPiolaKirchhoffStressTensor<HyperelasticityPolicyT, ViscoelasticityPolicyT, InternalVariablePolicyT>, 10ul>,
public Crtp::LocalVectorStorage<SecondPiolaKirchhoffStressTensor<HyperelasticityPolicyT, ViscoelasticityPolicyT, InternalVariablePolicyT>, 2ul>
{
......@@ -113,7 +113,7 @@ namespace MoReFEM
>;
//! Alias to the parent that provides LocalMatrixStorage.
using matrix_parent = Crtp::LocalMatrixStorage<self, 9ul>;
using matrix_parent = Crtp::LocalMatrixStorage<self, 10ul>;
//! Alias to the parent that provides LocalVectorStorage.
using vector_parent = Crtp::LocalVectorStorage<self, 2ul>;
......@@ -338,7 +338,8 @@ namespace MoReFEM
d2W,
linear_part_intermediate_matrix,
gradient_based_block,
gradient_displacement
gradient_displacement,
deformation_gradient
};
......
......@@ -112,7 +112,8 @@ namespace MoReFEM
{ dIndC_size, dIndC_size }, // d2W,
{ square_mesh_dimension, dIndC_size }, // linear_part_intermediate_matrix
{ mesh_dimension, mesh_dimension }, // gradient-based block
{ mesh_dimension, mesh_dimension } // gradient displacement
{ mesh_dimension, mesh_dimension }, // gradient displacement
{ mesh_dimension, mesh_dimension } // deformation gradient
}});
......@@ -454,6 +455,23 @@ namespace MoReFEM
const auto& De = derivative_green_lagrange.Update(gradient_displacement);
const auto& transposed_De = derivative_green_lagrange.GetTransposed();
# ifndef NDEBUG
{
auto& deformation_gradient = this->matrix_parent::template GetLocalMatrix<EnumUnderlyingType(LocalMatrixIndex::deformation_gradient)>();
deformation_gradient = gradient_displacement;
for (auto i = 0ul; i < DimensionT; ++i)
deformation_gradient(i, i) += 1.0; // F = Id + grad_y
const double determinant_deformation_gradient = xt::linalg::det(deformation_gradient);
assert(determinant_deformation_gradient > 0. && "Some mesh elements have been inverted."
"Consider using an adaptative loading method"
"(i.e continuation method for static cases or smaller"
"time steps for dynamic ones)." );
}
# endif //NDEBUG
// ===================================================================================
// Then compute the derivates of W, required to build both bilinear and linear terms.
// ===================================================================================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment