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 37 of file LinearBMatrix.h.

41{
42 static_assert(0 < DisplacementDim && DisplacementDim <= 3,
43 "LinearBMatrix::computeBMatrix: DisplacementDim must be in "
44 "range [1,3].");
45
46 BMatrixType B = BMatrixType::Zero(
48 NPOINTS * DisplacementDim);
49
50 switch (DisplacementDim)
51 {
52 case 3:
53 for (int i = 0; i < NPOINTS; ++i)
54 {
55 B(2, 2 * NPOINTS + i) = dNdx(2, i);
56 B(4, NPOINTS + i) = dNdx(2, i) / std::sqrt(2);
57 B(4, 2 * NPOINTS + i) = dNdx(1, i) / std::sqrt(2);
58 B(5, i) = dNdx(2, i) / std::sqrt(2);
59 B(5, 2 * NPOINTS + i) = dNdx(0, i) / std::sqrt(2);
60 }
62 break;
63 case 2:
65 if (is_axially_symmetric)
66 {
67 for (int i = 0; i < NPOINTS; ++i)
68 {
69 B(2, i) = N[i] / radius;
70 }
71 }
72 break;
73 default:
74 break;
75 }
76
77 return B;
78}
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
void fillBMatrix2DCartesianPart(DNDX_Type const &dNdx, BMatrixType &B)

References ProcessLib::LinearBMatrix::detail::fillBMatrix2DCartesianPart(), and MathLib::KelvinVector::kelvin_vector_dimensions().

Referenced by ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::HMPhaseField::HMPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< 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::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postNonLinearSolverConcrete(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcrete(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveRelations(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariables(), and ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariablesDerivatives().

◆ 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 173 of file LinearBMatrix.h.

179{
180 auto B = computeBMatrix<DisplacementDim, NPOINTS, BMatrixType, N_Type,
181 DNDX_Type>(dNdx, N, radius, is_axially_symmetric);
182
183 if (!B_dil_bar)
184 {
185 return B;
186 }
187
189 *B_dil_bar, B, is_axially_symmetric);
190
191 return B;
192}
void applyBbar(BBarMatrixType const &B_bar, BMatrixType &B, const bool is_axially_symmetric)
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 ProcessLib::LinearBMatrix::detail::applyBbar(), and computeBMatrix().

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

◆ 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 82 of file LinearBMatrix.h.

87{
88 unsigned const n_integration_points =
89 integration_method.getNumberOfPoints();
90
91 BBarMatrixType B_bar = BBarMatrixType::Zero(3, ShapeFunction::NPOINTS);
92
93 // Compute the element volume
94 double volume = 0.0;
95 for (unsigned ip = 0; ip < n_integration_points; ip++)
96 {
97 auto const& w = ip_data[ip].integration_weight;
98 volume += w;
99 }
100
101 for (int i = 0; i < NPOINTS; i++)
102 {
103 B_bar.col(i).noalias() +=
105 ShapeMatricesType, IpData>(
106 i, element, integration_method, ip_data, is_axially_symmetric);
107 }
108
109 return B_bar / volume;
110}
Eigen::Vector3d averageGradShapeFunction(int const local_node_id, MeshLib::Element const &element, NumLib::GenericIntegrationMethod const &integration_method, std::vector< IpData, Eigen::aligned_allocator< IpData > > const &ip_data, const bool is_axially_symmetric)

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

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