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>& local_rhs_data,
113 std::vector<double>& local_Jac_data)
override;
117 unsigned const n_integration_points =
120 for (
unsigned ip = 0; ip < n_integration_points; ip++)
128 ShapeFunctionDisplacement,
137 std::numeric_limits<double>::quiet_NaN()
145 ip_data.solid_material.initializeInternalStateVariables(
146 t, x_position, *ip_data.material_state_variables);
148 ip_data.pushBackState();
154 int const process_id)
override;
157 double const ,
double const )
override
159 unsigned const n_integration_points =
162 for (
unsigned ip = 0; ip < n_integration_points; ip++)
165 DisplacementDim, std::numeric_limits<double>::quiet_NaN());
170 Eigen::VectorXd
const& local_x_prev,
171 double const t,
double const dt,
174 unsigned const n_integration_points =
177 auto const [T_prev, p_prev, u_prev] =
localDOF(local_x_prev);
179 for (
unsigned ip = 0; ip < n_integration_points; ip++)
182 auto const& N_u = ip_data.N_u;
183 auto const& dNdx_u = ip_data.dNdx_u;
189 ShapeFunctionDisplacement,
200 DisplacementDim, ShapeFunctionDisplacement::NPOINTS,
207 eps_prev = B * u_prev;
212 (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 =
244 return transposeInPlace<kelvin_vector_size>(
245 [
this](std::vector<double>& values)
251 std::vector<GlobalVector*>
const& x,
252 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
253 std::vector<double>& cache)
const override;
257 std::vector<GlobalVector*>
const& x,
258 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
259 std::vector<double>& cache)
const override;
267 ShapeFunctionDisplacement::NPOINTS>;
271 Eigen::Ref<Eigen::VectorXd const>
const local_x,
272 Eigen::Ref<Eigen::VectorXd const>
const local_x_prev,
274 double const dt,
IpData& ip_data,
279 return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
285 std::vector<GlobalVector*>
const& ,
286 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
287 std::vector<double>& cache)
const override
289 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
295 std::vector<GlobalVector*>
const& ,
296 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
297 std::vector<double>& cache)
const override
299 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
305 constexpr int kelvin_vector_size =
308 return transposeInPlace<kelvin_vector_size>(
309 [
this](std::vector<double>& values)
315 std::vector<GlobalVector*>
const& ,
316 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
317 std::vector<double>& cache)
const override
319 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
325 constexpr int kelvin_vector_size =
328 return transposeInPlace<kelvin_vector_size>(
329 [
this](std::vector<double>& values)
335 std::vector<GlobalVector*>
const& ,
336 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
337 std::vector<double>& cache)
const override
339 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
345 std::vector<GlobalVector*>
const& ,
346 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
347 std::vector<double>& cache)
const override
366 std::function<std::span<double>(
368 MaterialStateVariables&)> const& get_values_span,
369 int const& n_components) const override
377 DisplacementDim>::MaterialStateVariables
const&
380 return *
_ip_data[integration_point].material_state_variables;
384 template <
typename SolutionVector>
385 static constexpr auto localDOF(SolutionVector
const& x)
388 ShapeFunctionPressure, ShapeFunctionPressure,
394 std::vector<IpData, Eigen::aligned_allocator<IpData>>
_ip_data;
395 std::vector<IntegrationPointDataForOutput<DisplacementDim>,
396 Eigen::aligned_allocator<
404 typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType>
415 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
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
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.
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