OGS
ProcessLib::LinearBMatrix Namespace Reference

Namespaces

namespace  detail
 

Functions

template<int DisplacementDim, int NPOINTS, typename BMatrixType , typename N_Type , typename DNDX_Type >
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.
 
template<int DisplacementDim, int NPOINTS, typename ShapeFunction , typename BBarMatrixType , typename ShapeMatricesType , typename IpData >
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)
 
template<int DisplacementDim, int NPOINTS, typename BBarMatrixType , typename BMatrixType , typename N_Type , typename DNDX_Type >
BMatrixType computeBMatrixPossiblyWithBbar (DNDX_Type const &dNdx, N_Type const &N, std::optional< BBarMatrixType > const &B_dil_bar, const double radius, const bool is_axially_symmetric)
 Fills a B matrix, or a B bar matrix if required.
 

Function Documentation

◆ computeBMatrix()

template<int DisplacementDim, int NPOINTS, typename BMatrixType , typename N_Type , typename DNDX_Type >
BMatrixType ProcessLib::LinearBMatrix::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.

Definition at line 46 of file LinearBMatrix.h.

50{
51 static_assert(0 < DisplacementDim && DisplacementDim <= 3,
52 "LinearBMatrix::computeBMatrix: DisplacementDim must be in "
53 "range [1,3].");
54
55 BMatrixType B = BMatrixType::Zero(
57 NPOINTS * DisplacementDim);
58
59 switch (DisplacementDim)
60 {
61 case 3:
62 for (int i = 0; i < NPOINTS; ++i)
63 {
64 B(2, 2 * NPOINTS + i) = dNdx(2, i);
65 B(4, NPOINTS + i) = dNdx(2, i) / std::sqrt(2);
66 B(4, 2 * NPOINTS + i) = dNdx(1, i) / std::sqrt(2);
67 B(5, i) = dNdx(2, i) / std::sqrt(2);
68 B(5, 2 * NPOINTS + i) = dNdx(0, i) / std::sqrt(2);
69 }
70 detail::fillBMatrix2DCartesianPart<NPOINTS>(dNdx, B);
71 break;
72 case 2:
73 detail::fillBMatrix2DCartesianPart<NPOINTS>(dNdx, B);
74 if (is_axially_symmetric)
75 {
76 for (int i = 0; i < NPOINTS; ++i)
77 {
78 B(2, i) = N[i] / radius;
79 }
80 }
81 break;
82 default:
83 break;
84 }
85
86 return B;
87}
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.

References MathLib::KelvinVector::kelvin_vector_dimensions().

Referenced by ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianPhaseFieldEquations(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::assembleWithJacobianSingleIP(), computeBMatrixPossiblyWithBbar(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::computeSecondaryVariableConcrete(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::getNodalValues(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postNonLinearSolverConcrete(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcrete(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::preAssemble(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveRelations(), and ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariables().

◆ computeBMatrixPossiblyWithBbar()

template<int DisplacementDim, int NPOINTS, typename BBarMatrixType , typename BMatrixType , typename N_Type , typename DNDX_Type >
BMatrixType ProcessLib::LinearBMatrix::computeBMatrixPossiblyWithBbar ( DNDX_Type const & dNdx,
N_Type const & N,
std::optional< BBarMatrixType > const & B_dil_bar,
const double radius,
const bool is_axially_symmetric )

Fills a B matrix, or a B bar matrix if required.

Definition at line 198 of file LinearBMatrix.h.

204{
205 auto B = computeBMatrix<DisplacementDim, NPOINTS, BMatrixType, N_Type,
206 DNDX_Type>(dNdx, N, radius, is_axially_symmetric);
207
208 if (!B_dil_bar)
209 {
210 return B;
211 }
212
213 detail::applyBbar<DisplacementDim, NPOINTS, BBarMatrixType, BMatrixType>(
214 *B_dil_bar, B, is_axially_symmetric);
215
216 return B;
217}
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.

References computeBMatrix().

Referenced by ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::assembleBlockMatricesWithJacobian(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete(), and ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::postTimestepConcreteWithBlockVectors().

◆ computeDilatationalBbar()

template<int DisplacementDim, int NPOINTS, typename ShapeFunction , typename BBarMatrixType , typename ShapeMatricesType , typename IpData >
BBarMatrixType ProcessLib::LinearBMatrix::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 )

Definition at line 91 of file LinearBMatrix.h.

96{
97 unsigned const n_integration_points =
98 integration_method.getNumberOfPoints();
99
100 BBarMatrixType B_bar = BBarMatrixType::Zero(3, ShapeFunction::NPOINTS);
101
102 // Compute the element volume
103 double volume = 0.0;
104 for (unsigned ip = 0; ip < n_integration_points; ip++)
105 {
106 auto const& w = ip_data[ip].integration_weight;
107 volume += w;
108 }
109
110 for (int i = 0; i < NPOINTS; i++)
111 {
112 auto B_bar_i = B_bar.col(i);
113 for (unsigned ip = 0; ip < n_integration_points; ip++)
114 {
115 auto const& N = ip_data[ip].N_u;
116 auto const& dNdx = ip_data[ip].dNdx_u;
117
118 auto const dNidx = dNdx.col(i);
119
120 auto const& w = ip_data[ip].integration_weight;
121 B_bar_i.template segment<DisplacementDim>(0) += dNidx * w;
122
123 if (is_axially_symmetric)
124 {
125 auto const x_coord =
126 NumLib::interpolateXCoordinate<ShapeFunction,
127 ShapeMatricesType>(element,
128 N);
129 B_bar_i[2] += w * N(i) / x_coord;
130 }
131 }
132 }
133
134 return B_bar / volume;
135}
double interpolateXCoordinate(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)

References NumLib::GenericIntegrationMethod::getNumberOfPoints(), and NumLib::interpolateXCoordinate().

Referenced by ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::getDilatationalBBarMatrix(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::getDilatationalBBarMatrix(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, DisplacementDim >::getDilatationalBBarMatrix(), and ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::getDilatationalBBarMatrix().