38namespace ThermoHydroMechanics
44template <
typename ShapeMatrixType>
47 std::vector<ShapeMatrixType, Eigen::aligned_allocator<ShapeMatrixType>>
N_u;
50template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
88 bool const is_axially_symmetric,
93 std::string_view
const name,
95 int const integration_order)
override;
98 std::vector<double>
const& ,
99 std::vector<double>
const& ,
100 std::vector<double>& ,
101 std::vector<double>& ,
102 std::vector<double>& )
override
105 "ThermoHydroMechanicsLocalAssembler: assembly without Jacobian is "
110 std::vector<double>
const& local_x,
111 std::vector<double>
const& local_x_prev,
112 std::vector<double>& ,
113 std::vector<double>& ,
114 std::vector<double>& local_rhs_data,
115 std::vector<double>& local_Jac_data)
override;
119 unsigned const n_integration_points =
122 for (
unsigned ip = 0; ip < n_integration_points; ip++)
130 ShapeFunctionDisplacement,
139 std::numeric_limits<double>::quiet_NaN()
147 ip_data.solid_material.initializeInternalStateVariables(
148 t, x_position, *ip_data.material_state_variables);
150 ip_data.pushBackState();
156 int const process_id)
override;
159 double const ,
double const )
override
161 unsigned const n_integration_points =
164 for (
unsigned ip = 0; ip < n_integration_points; ip++)
167 DisplacementDim, std::numeric_limits<double>::quiet_NaN());
172 Eigen::VectorXd
const& local_x_prev,
173 double const t,
double const dt,
176 unsigned const n_integration_points =
179 auto const [T_prev, p_prev, u_prev] =
localDOF(local_x_prev);
181 for (
unsigned ip = 0; ip < n_integration_points; ip++)
184 auto const& N_u = ip_data.N_u;
185 auto const& dNdx_u = ip_data.dNdx_u;
191 ShapeFunctionDisplacement,
202 DisplacementDim, ShapeFunctionDisplacement::NPOINTS,
209 eps_prev = B * u_prev;
214 (eps_prev -
_ip_data[ip].eps0_prev);
220 double const t,
double const dt, Eigen::VectorXd
const& local_x,
221 Eigen::VectorXd
const& local_x_prev)
override;
224 const unsigned integration_point)
const override
229 return Eigen::Map<const Eigen::RowVectorXd>(N_u.data(), N_u.size());
234 std::vector<GlobalVector*>
const& x,
235 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
236 std::vector<double>& cache)
const override;
243 constexpr int kelvin_vector_size =
246 return transposeInPlace<kelvin_vector_size>(
247 [
this](std::vector<double>& values)
253 std::vector<GlobalVector*>
const& x,
254 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
255 std::vector<double>& cache)
const override;
259 std::vector<GlobalVector*>
const& x,
260 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
261 std::vector<double>& cache)
const override;
269 ShapeFunctionDisplacement::NPOINTS>;
273 Eigen::Ref<Eigen::VectorXd const>
const local_x,
274 Eigen::Ref<Eigen::VectorXd const>
const local_x_prev,
276 double const dt,
IpData& ip_data,
281 return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
287 std::vector<GlobalVector*>
const& ,
288 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
289 std::vector<double>& cache)
const override
291 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
297 std::vector<GlobalVector*>
const& ,
298 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
299 std::vector<double>& cache)
const override
301 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
307 constexpr int kelvin_vector_size =
310 return transposeInPlace<kelvin_vector_size>(
311 [
this](std::vector<double>& values)
317 std::vector<GlobalVector*>
const& ,
318 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
319 std::vector<double>& cache)
const override
321 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
327 constexpr int kelvin_vector_size =
330 return transposeInPlace<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
341 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
347 std::vector<GlobalVector*>
const& ,
348 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
349 std::vector<double>& cache)
const override
368 std::function<std::span<double>(
370 MaterialStateVariables&)> const& get_values_span,
371 int const& n_components) const override
379 DisplacementDim>::MaterialStateVariables
const&
382 return *
_ip_data[integration_point].material_state_variables;
386 template <
typename SolutionVector>
387 static constexpr auto localDOF(SolutionVector
const& x)
390 ShapeFunctionPressure, ShapeFunctionPressure,
396 std::vector<IpData, Eigen::aligned_allocator<IpData>>
_ip_data;
397 std::vector<IntegrationPointDataForOutput<DisplacementDim>,
398 Eigen::aligned_allocator<
406 typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType>
417 ShapeFunctionDisplacement::NPOINTS * DisplacementDim;
std::size_t getID() const
Returns the ID of the element.
unsigned getNumberOfPoints() 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
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
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
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
std::vector< double > getEpsilonM() const override
std::vector< double > getEpsilon() const override
static constexpr auto localDOF(SolutionVector const &x)
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.
void assembleWithJacobian(double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &, std::vector< double > &, std::vector< double > &local_rhs_data, std::vector< double > &local_Jac_data) 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
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)
double interpolateXCoordinate(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
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 > getIntegrationPointDataMaterialStateVariables(IntegrationPointDataVector const &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span, int const n_components)
MatrixType< GlobalDim, GlobalDim > GlobalDimMatrixType
VectorType< GlobalDim > GlobalDimVectorType
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N_u
BMatricesType::KelvinVectorType eps_m
std::unique_ptr< typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables > material_state_variables
BMatricesType::KelvinVectorType sigma_eff
BMatricesType::KelvinVectorType eps
BMatricesType::KelvinVectorType sigma_eff_ice
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N_u