OGS
SmallDeformationLocalAssemblerMatrixNearFracture.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <unordered_map>
7#include <vector>
8
18#include "SecondaryData.h"
20
21namespace ProcessLib
22{
23namespace LIE
24{
25namespace SmallDeformation
26{
27namespace MPL = MaterialPropertyLib;
28
29template <typename ShapeFunction, int DisplacementDim>
32{
33public:
41
47
52
54 MeshLib::Element const& e,
55 std::size_t const n_variables,
56 std::size_t const local_matrix_size,
57 std::vector<unsigned> const& dofIndex_to_localIndex,
58 NumLib::GenericIntegrationMethod const& integration_method,
59 bool const is_axially_symmetric,
61
62 void assemble(double const /*t*/, double const /*dt*/,
63 std::vector<double> const& /*local_x*/,
64 std::vector<double> const& /*local_x_prev*/,
65 std::vector<double>& /*local_M_data*/,
66 std::vector<double>& /*local_K_data*/,
67 std::vector<double>& /*local_b_data*/) override
68 {
70 "SmallDeformationLocalAssembler: assembly without jacobian is not "
71 "implemented.");
72 }
73
74 void assembleWithJacobian(double const t, double const dt,
75 Eigen::VectorXd const& local_u,
76 Eigen::VectorXd& local_b,
77 Eigen::MatrixXd& local_J) override;
78
79 void preTimestepConcrete(std::vector<double> const& /*local_x*/,
80 double const /*t*/,
81 double const /*delta_t*/) override
82 {
83 unsigned const n_integration_points =
84 _integration_method.getNumberOfPoints();
85
86 for (unsigned ip = 0; ip < n_integration_points; ip++)
87 {
88 _ip_data[ip].pushBackState();
89 }
90 }
91
93 double const t, Eigen::VectorXd const& local_x) override;
94
95 Eigen::Map<const Eigen::RowVectorXd> getShapeMatrix(
96 const unsigned integration_point) const override
97 {
98 auto const& N = _secondary_data.N[integration_point];
99
100 // assumes N is stored contiguously in memory
101 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
102 }
103
104 std::vector<double> const& getIntPtSigma(
105 const double t,
106 std::vector<GlobalVector*> const& x,
107 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
108 std::vector<double>& cache) const override;
109
110 std::vector<double> const& getIntPtEpsilon(
111 const double t,
112 std::vector<GlobalVector*> const& x,
113 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
114 std::vector<double>& cache) const override;
115
116 std::vector<double> const& getIntPtFractureStress(
117 const double /*t*/,
118 std::vector<GlobalVector*> const& /*x*/,
119 std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
120 std::vector<double>& cache) const override
121 {
122 cache.resize(0);
123 return cache;
124 }
125
126 std::vector<double> const& getIntPtFractureAperture(
127 const double /*t*/,
128 std::vector<GlobalVector*> const& /*x*/,
129 std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
130 std::vector<double>& cache) const override
131 {
132 cache.resize(0);
133 return cache;
134 }
135
136private:
138 std::vector<FractureProperty*> _fracture_props;
139 std::vector<JunctionProperty*> _junction_props;
140 std::unordered_map<int, int> _fracID_to_local;
141
144 DisplacementDim>;
145
146 std::vector<IntegrationPointDataType,
147 Eigen::aligned_allocator<IntegrationPointDataType>>
149
151
155
156 std::optional<BBarMatrixType> getDilatationalBBarMatrix() const
157 {
158 if (!(_process_data.use_b_bar))
159 {
160 return std::nullopt;
161 }
162
164 DisplacementDim, ShapeFunction::NPOINTS, ShapeFunction,
166 _ip_data, this->_element, this->_integration_method,
167 this->_is_axially_symmetric);
168 }
169};
170
171} // namespace SmallDeformation
172} // namespace LIE
173} // namespace ProcessLib
174
#define OGS_FATAL(...)
Definition Error.h:19
EigenFixedShapeMatrixPolicy< ShapeFunction, GlobalDim > ShapeMatrixPolicyType
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
MatrixType< 3, ShapeFunction::NPOINTS > BBarMatrixType
MatrixType< _number_of_dof, _number_of_dof > StiffnessMatrixType
VectorType< _number_of_dof > NodalForceVectorType
Rhs residual.
IntegrationPointDataMatrix< ShapeMatricesType, BMatricesType, DisplacementDim > IntegrationPointDataType
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix(const unsigned integration_point) const override
Provides the shape matrix at the given integration point.
SmallDeformationLocalAssemblerMatrixNearFracture(SmallDeformationLocalAssemblerMatrixNearFracture const &)=delete
void assembleWithJacobian(double const t, double const dt, Eigen::VectorXd const &local_u, Eigen::VectorXd &local_b, Eigen::MatrixXd &local_J) override
std::vector< IntegrationPointDataType, Eigen::aligned_allocator< IntegrationPointDataType > > _ip_data
SmallDeformationLocalAssemblerMatrixNearFracture(SmallDeformationLocalAssemblerMatrixNearFracture &&)=delete
std::vector< double > const & getIntPtFractureStress(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const 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
std::vector< double > const & getIntPtFractureAperture(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
std::vector< double > const & getIntPtSigma(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 & getIntPtEpsilon(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
BBarMatrixType computeDilatationalBbar(std::vector< IpData, Eigen::aligned_allocator< IpData > > const &ip_data, MeshLib::Element const &element, NumLib::GenericIntegrationMethod const &integration_method, const bool is_axially_symmetric)
NumLib::ShapeMatrices< NodalRowVectorType, DimNodalMatrixType, DimMatrixType, GlobalDimNodalMatrixType > ShapeMatrices
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType
VectorType< ShapeFunction::NPOINTS > NodalVectorType