Commit c49d32fa authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#820 SolidDeltaResidual: remove parts that were used only for matricial contribution.

parent 12081ef9
......@@ -180,8 +180,7 @@ namespace HappyHeart
void ComputeWDerivates(const QuadraturePoint& quad_pt,
const GeometricElt& geom_elt,
const cauchy_green_tensor_type& cauchy_green_tensor,
LocalVector& dW,
LocalMatrix& d2W);
LocalVector& dW);
/*!
* \brief Compute internal data such as invariants, De, Cauchy-Green tensor for current quadrature point.
......@@ -234,7 +233,6 @@ namespace HappyHeart
dPhi_mult_gradient_based_block,
block_contribution,
transposed_dphi,
d2W,
linear_part_intermediate_matrix,
gradient_based_block,
gradient_displacement
......
......@@ -211,8 +211,7 @@ namespace HappyHeart
void SolidDeltaResidual<HyperelasticLawT>::ComputeWDerivates(const QuadraturePoint& quad_pt,
const GeometricElt& geom_elt,
const cauchy_green_tensor_type& cauchy_green_tensor,
LocalVector& dW,
LocalMatrix& d2W)
LocalVector& dW)
{
// static_cast<void>(pressure); // See #7.
......@@ -229,73 +228,6 @@ namespace HappyHeart
const double dWdI2 = law.FirstDerivativeWSecondInvariant(invariant_holder, quad_pt, geom_elt);
const double dWdI3 = law.FirstDerivativeWThirdInvariant(invariant_holder, quad_pt, geom_elt);
{
const auto& d2I1dC = invariant_holder.template GetSecondDerivativeWrtCauchyGreen<1>();
const auto& d2I2dC = invariant_holder.template GetSecondDerivativeWrtCauchyGreen<2>();
const auto& d2I3dC = invariant_holder.template GetSecondDerivativeWrtCauchyGreen<3>();
{
assert(Wrappers::Seldon::IsZeroMatrix(d2W));
Seldon::Add(dWdI1, d2I1dC, d2W);
Seldon::Add(dWdI2, d2I2dC, d2W);
Seldon::Add(dWdI3, d2I3dC, d2W);
# ifndef NDEBUG
Wrappers::Seldon::ThrowIfNanInside(d2W, __FILE__, __LINE__);
# endif // NDEBUG
}
{
const double d2WdI1dI1 =
law.SecondDerivativeWFirstInvariant(invariant_holder, quad_pt, geom_elt);
const double d2WdI2dI2 =
law.SecondDerivativeWSecondInvariant(invariant_holder, quad_pt, geom_elt);
const double d2WdI3dI3 =
law.SecondDerivativeWThirdInvariant(invariant_holder, quad_pt, geom_elt);
const double d2WdI1dI2 =
law.SecondDerivativeWFirstAndSecondInvariant(invariant_holder, quad_pt, geom_elt);
const double d2WdI1dI3 =
law.SecondDerivativeWFirstAndThirdInvariant(invariant_holder, quad_pt, geom_elt);
const double d2WdI2dI3 =
law.SecondDerivativeWSecondAndThirdInvariant(invariant_holder, quad_pt, geom_elt);
using namespace Wrappers::Seldon;
auto& outer_prod = GetNonCstWorkMatrixOuterProduct();
OuterProd(dI1dC, dI1dC, outer_prod);
Seldon::Add(d2WdI1dI1, outer_prod, d2W);
OuterProd(dI1dC, dI2dC, outer_prod);
Seldon::Add(d2WdI1dI2, outer_prod, d2W);
OuterProd(dI1dC, dI3dC, outer_prod);
Seldon::Add(d2WdI1dI3, outer_prod, d2W);
OuterProd(dI2dC, dI1dC, outer_prod);
Seldon::Add(d2WdI1dI2, outer_prod, d2W);
OuterProd(dI2dC, dI2dC, outer_prod);
Seldon::Add(d2WdI2dI2, outer_prod, d2W);
OuterProd(dI2dC, dI3dC, outer_prod);
Seldon::Add(d2WdI2dI3, outer_prod, d2W);
OuterProd(dI3dC, dI1dC, outer_prod);
Seldon::Add(d2WdI1dI3, outer_prod, d2W);
OuterProd(dI3dC, dI2dC, outer_prod);
Seldon::Add(d2WdI2dI3, outer_prod, d2W);
OuterProd(dI3dC, dI3dC, outer_prod);
Seldon::Add(d2WdI3dI3, outer_prod, d2W);
}
Seldon::Mlt(4., d2W);
}
{
assert(Wrappers::Seldon::IsZeroVector(dW));
Seldon::Add(dWdI1, dI1dC, dW);
......@@ -417,21 +349,14 @@ namespace HappyHeart
// ===================================================================================
auto& dW = this->vector_parent::template GetLocalVector<EnumUnderlyingType(LocalVectorIndex::dW)>();
auto& d2W = this->matrix_parent::template GetLocalMatrix<EnumUnderlyingType(LocalMatrixIndex::d2W)>();
// Put to zero as in each ComputeWDerivates of the policies once should add the contributions and use Add.
dW.Zero();
d2W.Zero();
ComputeWDerivates(infos_at_quad_pt.GetQuadraturePoint(),
geom_elt,
cauchy_green_tensor,
dW,
d2W);
# ifndef NDEBUG
Wrappers::Seldon::ThrowIfNanInside(d2W, __FILE__, __LINE__);
# endif // NDEBUG
dW);
// ===================================================================================
// Finally build the terms that are actually required.
......
Supports Markdown
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