33namespace MPL = MaterialPropertyLib;
37template <
typename ShapeMatrixType>
40 std::vector<ShapeMatrixType, Eigen::aligned_allocator<ShapeMatrixType>>
N_u;
43template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
81 bool const is_axially_symmetric,
86 std::string_view
const name,
88 int const integration_order)
override;
91 std::vector<double>
const& ,
92 std::vector<double>
const& ,
93 std::vector<double>& ,
94 std::vector<double>& ,
95 std::vector<double>& )
override
98 "ThermoHydroMechanicsLocalAssembler: assembly without Jacobian is "
103 std::vector<double>
const& local_x,
104 std::vector<double>
const& local_x_prev,
105 std::vector<double>& local_rhs_data,
106 std::vector<double>& local_Jac_data)
override;
110 unsigned const n_integration_points =
113 for (
unsigned ip = 0; ip < n_integration_points; ip++)
121 ShapeFunctionDisplacement,
130 std::numeric_limits<double>::quiet_NaN()
138 ip_data.solid_material.initializeInternalStateVariables(
139 t, x_position, *ip_data.material_state_variables);
141 ip_data.pushBackState();
147 int const process_id)
override;
150 double const ,
double const )
override
152 unsigned const n_integration_points =
155 for (
unsigned ip = 0; ip < n_integration_points; ip++)
158 DisplacementDim, std::numeric_limits<double>::quiet_NaN());
163 Eigen::VectorXd
const& local_x_prev,
164 double const t,
double const dt,
167 unsigned const n_integration_points =
170 auto const [T, p, u] =
localDOF(local_x);
171 auto const [T_prev, p_prev, u_prev] =
localDOF(local_x_prev);
174 double sensible_heat = 0.0;
176 for (
unsigned ip = 0; ip < n_integration_points; ip++)
179 auto const& N_u = ip_data.N_u;
180 auto const& dNdx_u = ip_data.dNdx_u;
186 ShapeFunctionDisplacement,
190 local_x, local_x_prev, x_position, t, dt,
_ip_data[ip],
194 sensible_heat += crv.sensible_volumetric_heat_capacity *
195 ip_data.N.dot(T) * ip_data.integration_weight;
200 DisplacementDim, ShapeFunctionDisplacement::NPOINTS,
205 eps_prev = B * u_prev;
210 (eps_prev -
_ip_data[ip].eps0_prev);
218 double const t,
double const dt, Eigen::VectorXd
const& local_x,
219 Eigen::VectorXd
const& local_x_prev)
override;
222 const unsigned integration_point)
const override
227 return Eigen::Map<const Eigen::RowVectorXd>(N_u.data(), N_u.size());
232 std::vector<GlobalVector*>
const& x,
233 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
234 std::vector<double>& cache)
const override;
241 constexpr int kelvin_vector_size =
245 [
this](std::vector<double>& values)
251 constexpr int kelvin_vector_size =
255 [
this](std::vector<double>& values)
261 std::vector<double> result;
268 std::vector<GlobalVector*>
const& x,
269 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
270 std::vector<double>& cache)
const override;
274 std::vector<GlobalVector*>
const& x,
275 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
276 std::vector<double>& cache)
const override;
289 ShapeFunctionDisplacement::NPOINTS>;
293 Eigen::Ref<Eigen::VectorXd const>
const local_x,
294 Eigen::Ref<Eigen::VectorXd const>
const local_x_prev,
296 double const dt,
IpData& ip_data,
307 std::vector<GlobalVector*>
const& ,
308 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
309 std::vector<double>& cache)
const override
317 std::vector<GlobalVector*>
const& ,
318 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
319 std::vector<double>& cache)
const override
327 constexpr int kelvin_vector_size =
331 [
this](std::vector<double>& values)
337 std::vector<GlobalVector*>
const& ,
338 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
339 std::vector<double>& cache)
const override
346 constexpr int kelvin_vector_size =
350 [
this](std::vector<double>& values)
356 std::vector<GlobalVector*>
const& ,
357 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
358 std::vector<double>& cache)
const override
366 constexpr int kelvin_vector_size =
370 [
this](std::vector<double>& values)
376 std::vector<GlobalVector*>
const& ,
377 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
378 std::vector<double>& cache)
const override
386 std::vector<GlobalVector*>
const& ,
387 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
388 std::vector<double>& cache)
const override
407 std::function<std::span<double>(
409 MaterialStateVariables&)>
const& get_values_span,
410 int const& n_components)
const override
418 DisplacementDim>::MaterialStateVariables
const&
421 return *
_ip_data[integration_point].material_state_variables;
425 template <
typename SolutionVector>
426 static constexpr auto localDOF(SolutionVector
const& x)
429 ShapeFunctionPressure, ShapeFunctionPressure,
435 std::vector<IpData, Eigen::aligned_allocator<IpData>>
_ip_data;
436 std::vector<IntegrationPointDataForOutput<DisplacementDim>,
437 Eigen::aligned_allocator<
445 typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType>
456 ShapeFunctionDisplacement::NPOINTS * DisplacementDim;
EigenFixedShapeMatrixPolicy< ShapeFunction, GlobalDim > ShapeMatrixPolicyType
std::optional< MathLib::Point3d > const getCoordinates() const
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
std::vector< double > const & getIntPtViscosity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
unsigned getNumberOfIntegrationPoints() const override
std::vector< double > const & getIntPtFluidDensity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
std::vector< double > getEpsilon0() const override
void setInitialConditionsConcrete(Eigen::VectorXd const local_x, double const t, int const process_id) override
void assemble(double const, double const, std::vector< double > const &, std::vector< double > const &, std::vector< double > &, std::vector< double > &, std::vector< double > &) override
static const int pressure_size
ThermoHydroMechanicsLocalAssembler(ThermoHydroMechanicsLocalAssembler const &)=delete
std::vector< double > getMaterialStateVariableInternalState(std::function< std::span< double >(typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables &)> const &get_values_span, int const &n_components) const override
std::vector< double > const & getIntPtSigmaIce(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
static const int pressure_index
typename ShapeMatricesTypePressure::GlobalDimMatrixType GlobalDimMatrixType
static int const KelvinVectorSize
static const int displacement_size
std::size_t setSigma(double const *values)
ConstitutiveRelationsValues< DisplacementDim > updateConstitutiveRelations(Eigen::Ref< Eigen::VectorXd const > const local_x, Eigen::Ref< Eigen::VectorXd const > const local_x_prev, ParameterLib::SpatialPosition const &x_position, double const t, double const dt, IpData &ip_data, IntegrationPointDataForOutput< DisplacementDim > &ip_data_output) const
int getMaterialID() const override
ShapeMatrixPolicyType< ShapeFunctionDisplacement, DisplacementDim > ShapeMatricesTypeDisplacement
void preTimestepConcrete(std::vector< double > const &, double const, double const) override
BMatrixPolicyType< ShapeFunctionDisplacement, DisplacementDim > BMatricesType
int getNumberOfVectorElementsForDeformation() const override
NumLib::GenericIntegrationMethod const & _integration_method
static const int temperature_size
typename ShapeMatricesTypePressure::GlobalDimVectorType GlobalDimVectorType
Eigen::Matrix< double, KelvinVectorSize, 1 > SymmetricTensor
virtual std::vector< double > const & getIntPtEpsilon(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
void assembleWithJacobian(double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_rhs_data, std::vector< double > &local_Jac_data) override
IntegrationPointData< BMatricesType, ShapeMatricesTypeDisplacement, ShapeMatricesTypePressure, DisplacementDim, ShapeFunctionDisplacement::NPOINTS > IpData
ThermoHydroMechanicsProcessData< DisplacementDim > & _process_data
std::vector< IntegrationPointDataForOutput< DisplacementDim >, Eigen::aligned_allocator< IntegrationPointDataForOutput< DisplacementDim > > > _ip_data_output
bool const _is_axially_symmetric
void postTimestepConcrete(Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, double const t, double const dt, int const) override
void initializeConcrete() override
std::vector< double > getSigma() const override
static constexpr auto & N_u_op
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType > _secondary_data
MeshLib::Element const & _element
ShapeMatrixPolicyType< ShapeFunctionPressure, DisplacementDim > ShapeMatricesTypePressure
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
static const int temperature_index
virtual std::vector< double > const & getIntPtEpsilonM(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
std::vector< double > const & getIntPtIceVolume(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
MathLib::KelvinVector::Invariants< KelvinVectorSize > Invariants
std::vector< double > getEpsilonM() const override
std::vector< double > getEpsilon() const override
static constexpr auto localDOF(SolutionVector const &x)
std::vector< double > getSigmaIce() const override
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & getMaterialStateVariablesAt(unsigned integration_point) const override
std::size_t setIPDataInitialConditions(std::string_view const name, double const *values, int const integration_order) override
Returns number of read integration points.
virtual std::vector< double > const & getIntPtEpsilon0(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
ThermoHydroMechanicsLocalAssembler(ThermoHydroMechanicsLocalAssembler &&)=delete
void computeSecondaryVariableConcrete(double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev) override
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix(const unsigned integration_point) const override
Provides the shape matrix at the given integration point.
std::vector< double > const & getIntPtDarcyVelocity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
std::vector< double > const & getIntPtSigma(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
static const int displacement_index
std::vector< double > getIceVolumeFraction() const override
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
Eigen::Matrix< double, Eigen::MatrixBase< Derived >::RowsAtCompileTime, 1 > symmetricTensorToKelvinVector(Eigen::MatrixBase< Derived > const &v)
constexpr Eigen::CwiseNullaryOp< EigenBlockMatrixViewFunctor< D, M >, typename EigenBlockMatrixViewFunctor< D, M >::Matrix > eigenBlockMatrixView(const Eigen::MatrixBase< M > &matrix)
auto localDOF(ElementDOFVector const &x)
std::array< double, 3 > interpolateCoordinates(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
BMatrixType computeBMatrix(DNDX_Type const &dNdx, N_Type const &N, const double radius, const bool is_axially_symmetric)
Fills a B-matrix based on given shape function dN/dx values.
std::vector< double > const & getIntegrationPointScalarData(IntegrationPointDataVector const &ip_data_vector, MemberType IpData::*const member, std::vector< double > &cache)
std::vector< double > transposeInPlace(StoreValuesFunction const &store_values_function)
std::vector< double > getIntegrationPointDataMaterialStateVariables(IntegrationPointDataVector const &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span, int const n_components)
std::vector< double > const & getIntegrationPointKelvinVectorData(IntegrationPointDataVector const &ip_data_vector, MemberType IpData::*const member, std::vector< double > &cache)
std::size_t setIntegrationPointKelvinVectorData(double const *values, IntegrationPointDataVector &ip_data_vector, MemberType IpData::*const member)
MatrixType< GlobalDim, GlobalDim > GlobalDimMatrixType
VectorType< GlobalDim > GlobalDimVectorType
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType
BMatricesType::KelvinVectorType eps_m
std::unique_ptr< typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables > material_state_variables
BMatricesType::KelvinVectorType eps0
BMatricesType::KelvinVectorType sigma_eff
BMatricesType::KelvinVectorType eps
BMatricesType::KelvinVectorType sigma_eff_ice
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N_u