OGS
NumLib::detail Namespace Reference

Detailed Description

Classes

struct  ByComponent
 
struct  ByGlobalIndex
 
struct  ByLocation
 
struct  ByLocationAndComponent
 
struct  ComputeDerivativeWrtOneScalar_CD
 
struct  ComputeDerivativeWrtOneScalar_FD
 
struct  DefaultPerturbationStrategy
 
struct  FieldType
 
struct  IsScalar
 
struct  IsScalar< Eigen::Matrix< double, N, 1, Eigen::ColMajor, N, 1 > >
 
struct  Line
 
struct  LineByLocationAndComponentComparator
 
struct  LineByLocationComparator
 
struct  LowerOrderShapeFunctionOrSame
 
struct  LowerOrderShapeFunctionOrSame< ShapeFunction, std::void_t< typename NumLib::LowerDim< ShapeFunction >::type > >
 
struct  NumberOfDofs
 
struct  NumberOfDofs< Vectorial< ShapeFunction, Dim > >
 
struct  ShapeDataFieldType
 
struct  ShapeFunctionTraits
 

Typedefs

using ComponentGlobalIndexDict = boost::multi_index::multi_index_container< Line, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< ByLocationAndComponent >, boost::multi_index::identity< Line >, LineByLocationAndComponentComparator >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ByLocation >, boost::multi_index::identity< Line >, LineByLocationComparator >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ByComponent >, boost::multi_index::member< Line, int, &Line::comp_id > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ByGlobalIndex >, boost::multi_index::member< Line, GlobalIndexType, &Line::global_index > > > >
 
template<typename ElementTraitsLagrange >
using GetMeshElement = typename ElementTraitsLagrange::Element
 
template<typename ElementTraitsLagrange >
using GetShapeFunctionHigherOrder = typename ElementTraitsLagrange::ShapeFunction
 
template<typename ElementTraitsLagrange >
using GetShapeFunctionLowerOrder = typename ElementTraitsLagrange::LowerOrderShapeFunction
 
template<typename ShapeFunction >
using GetShapeMatrixPolicy = ShapeMatrixPolicyType< ShapeFunction, 3 >
 
template<typename ShapeMatrixPolicy >
using GetShapeMatrix_N = typename ShapeMatrixPolicy::ShapeMatrices::ShapeType
 

Functions

template<typename... Ns_t, typename ElementDOFVector , int... Offsets, int... Sizes>
auto localDOFImpl (ElementDOFVector const &x, boost::mp11::mp_list_c< int, Offsets... >, boost::mp11::mp_list_c< int, Sizes... >)
 
template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void computeMappingMatrices (const MeshLib::Element &, const double *natural_pt, const MeshLib::ElementCoordinatesMappingLocal &, T_SHAPE_MATRICES &shapemat, FieldType< ShapeMatrixType::N >)
 
template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void computeMappingMatrices (const MeshLib::Element &, const double *natural_pt, const MeshLib::ElementCoordinatesMappingLocal &, T_SHAPE_MATRICES &shapemat, FieldType< ShapeMatrixType::DNDR >)
 
static void checkJacobianDeterminant (const double detJ, MeshLib::Element const &element)
 
template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void computeMappingMatrices (const MeshLib::Element &ele, const double *natural_pt, const MeshLib::ElementCoordinatesMappingLocal &ele_local_coord, T_SHAPE_MATRICES &shapemat, FieldType< ShapeMatrixType::DNDR_J >)
 
template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void computeMappingMatrices (const MeshLib::Element &ele, const double *natural_pt, const MeshLib::ElementCoordinatesMappingLocal &ele_local_coord, T_SHAPE_MATRICES &shapemat, FieldType< ShapeMatrixType::N_J >)
 
template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void computeMappingMatrices (const MeshLib::Element &ele, const double *natural_pt, const MeshLib::ElementCoordinatesMappingLocal &ele_local_coord, T_SHAPE_MATRICES &shapemat, FieldType< ShapeMatrixType::DNDX >)
 
template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void computeMappingMatrices (const MeshLib::Element &ele, const double *natural_pt, const MeshLib::ElementCoordinatesMappingLocal &ele_local_coord, T_SHAPE_MATRICES &shapemat, FieldType< ShapeMatrixType::ALL >)
 
template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES , ShapeMatrixType T_SHAPE_MATRIX_TYPE>
void naturalCoordinatesMappingComputeShapeMatrices (const MeshLib::Element &ele, const double *natural_pt, T_SHAPE_MATRICES &shapemat, const unsigned global_dim)
 Used to explicitly instantiate the NaturalCoordinatesMapping class template.
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeHex20)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeHex8)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeLine2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeLine3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapePoint1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapePrism15)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapePrism6)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapePyra13)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapePyra5)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeQuad4)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeQuad8)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeQuad9)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeTet10)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeTet4)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeTri3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN (ShapeTri6)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeHex20, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeHex8, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeLine2, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeLine3, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePoint1, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePrism15, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePrism6, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePyra13, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePyra5, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeQuad4, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeQuad8, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeQuad9, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTet10, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTet4, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTri3, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTri6, 1)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeHex20, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeHex8, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeLine2, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeLine3, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePoint1, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePrism15, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePrism6, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePyra13, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePyra5, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeQuad4, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeQuad8, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeQuad9, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTet10, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTet4, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTri3, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTri6, 2)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeHex20, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeHex8, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeLine2, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeLine3, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePoint1, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePrism15, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePrism6, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePyra13, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapePyra5, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeQuad4, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeQuad8, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeQuad9, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTet10, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTet4, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTri3, 3)
 
 OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX (ShapeTri6, 3)
 
template<class T >
void setMatrixZero (T &mat)
 
template<class T >
void setVectorZero (T &vec)
 
template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void setZero (ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape, ShapeDataFieldType< ShapeMatrixType::N >)
 
template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void setZero (ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape, ShapeDataFieldType< ShapeMatrixType::DNDR >)
 
template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void setZero (ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape, ShapeDataFieldType< ShapeMatrixType::DNDR_J >)
 
template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void setZero (ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape, ShapeDataFieldType< ShapeMatrixType::N_J >)
 
template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void setZero (ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape, ShapeDataFieldType< ShapeMatrixType::DNDX >)
 
template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void setZero (ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape, ShapeDataFieldType< ShapeMatrixType::ALL >)
 
template<unsigned DOFOffset, typename NodalValues , typename ShapeMatrix >
void shapeFunctionInterpolate (const NodalValues &, const ShapeMatrix &)
 
template<unsigned DOFOffset, typename NodalValues , typename ShapeMatrix , typename... ScalarTypes>
void shapeFunctionInterpolate (const NodalValues &nodal_values, const ShapeMatrix &shape_matrix_N, double &interpolated_value, ScalarTypes &... interpolated_values)
 
template<std::size_t IndexInTuple, typename Tuple >
double getScalarOrVectorComponent (Tuple const &tuple, Eigen::Index component)
 
template<typename IPData , typename FluxVectorType , typename Derived >
void assembleAdvectionMatrix (IPData const &ip_data_vector, std::vector< FluxVectorType > const &ip_flux_vector, Eigen::MatrixBase< Derived > &laplacian_matrix)
 
template<typename Derived >
void applyFullUpwind (Eigen::VectorXd const &quasi_nodal_flux, Eigen::MatrixBase< Derived > &laplacian_matrix)
 
template<typename IPData , typename FluxVectorType , typename Derived >
void applyFullUpwind (IPData const &ip_data_vector, std::vector< FluxVectorType > const &ip_flux_vector, Eigen::MatrixBase< Derived > &laplacian_matrix)
 
template<typename MatrixVectorType >
std::unique_ptr< MatrixVectorType > newZeroedInstance (MathLib::MatrixSpecifications const &matrix_specification)
 
void calculateFluxCorrectedTransport (const double t, const double dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, const MathLib::MatrixSpecifications &matrix_specification, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)
 
Eigen::MatrixXd getHydrodynamicDispersion (Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)
 
Eigen::MatrixXd getHydrodynamicDispersionWithArtificialDiffusion (IsotropicDiffusionStabilization const &stabilizer, std::size_t const element_id, Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)
 
bool solvePicard (GlobalLinearSolver &linear_solver, GlobalMatrix &A, GlobalVector &rhs, GlobalVector &x, bool const compute_necessary)
 

Typedef Documentation

◆ ComponentGlobalIndexDict

using NumLib::detail::ComponentGlobalIndexDict = typedef boost::multi_index::multi_index_container< Line, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag<ByLocationAndComponent>, boost::multi_index::identity<Line>, LineByLocationAndComponentComparator>, boost::multi_index::ordered_non_unique< boost::multi_index::tag<ByLocation>, boost::multi_index::identity<Line>, LineByLocationComparator>, boost::multi_index::ordered_non_unique< boost::multi_index::tag<ByComponent>, boost::multi_index::member<Line, int, &Line::comp_id> >, boost::multi_index::ordered_non_unique< boost::multi_index::tag<ByGlobalIndex>, boost::multi_index::member<Line, GlobalIndexType, &Line::global_index> >> >

Definition at line 104 of file ComponentGlobalIndexDict.h.

◆ GetMeshElement

template<typename ElementTraitsLagrange >
using NumLib::detail::GetMeshElement = typedef typename ElementTraitsLagrange::Element

Definition at line 23 of file ShapeMatrixCache.h.

◆ GetShapeFunctionHigherOrder

template<typename ElementTraitsLagrange >
using NumLib::detail::GetShapeFunctionHigherOrder = typedef typename ElementTraitsLagrange::ShapeFunction

Definition at line 26 of file ShapeMatrixCache.h.

◆ GetShapeFunctionLowerOrder

template<typename ElementTraitsLagrange >
using NumLib::detail::GetShapeFunctionLowerOrder = typedef typename ElementTraitsLagrange::LowerOrderShapeFunction

Definition at line 30 of file ShapeMatrixCache.h.

◆ GetShapeMatrix_N

template<typename ShapeMatrixPolicy >
using NumLib::detail::GetShapeMatrix_N = typedef typename ShapeMatrixPolicy::ShapeMatrices::ShapeType

Definition at line 41 of file ShapeMatrixCache.h.

◆ GetShapeMatrixPolicy

template<typename ShapeFunction >
using NumLib::detail::GetShapeMatrixPolicy = typedef ShapeMatrixPolicyType<ShapeFunction, 3 >

Definition at line 34 of file ShapeMatrixCache.h.

Function Documentation

◆ applyFullUpwind() [1/2]

template<typename Derived >
void NumLib::detail::applyFullUpwind ( Eigen::VectorXd const &  quasi_nodal_flux,
Eigen::MatrixBase< Derived > &  laplacian_matrix 
)

Definition at line 40 of file AdvectionMatrixAssembler.h.

42{
43 Eigen::VectorXd const down_mask =
44 (quasi_nodal_flux.array() < 0).cast<double>();
45 Eigen::VectorXd const down = quasi_nodal_flux.cwiseProduct(down_mask);
46
47 double const q_in = -down.sum();
48 if (q_in < std::numeric_limits<double>::epsilon())
49 {
50 return;
51 }
52
53 Eigen::VectorXd const up_mask =
54 (quasi_nodal_flux.array() >= 0).cast<double>();
55 Eigen::VectorXd const up = quasi_nodal_flux.cwiseProduct(up_mask);
56
57 laplacian_matrix.diagonal().noalias() += up;
58 laplacian_matrix.noalias() += down * up.transpose() / q_in;
59}

Referenced by applyFullUpwind(), and NumLib::assembleAdvectionMatrix().

◆ applyFullUpwind() [2/2]

template<typename IPData , typename FluxVectorType , typename Derived >
void NumLib::detail::applyFullUpwind ( IPData const &  ip_data_vector,
std::vector< FluxVectorType > const &  ip_flux_vector,
Eigen::MatrixBase< Derived > &  laplacian_matrix 
)

Definition at line 62 of file AdvectionMatrixAssembler.h.

65{
66 Eigen::VectorXd quasi_nodal_flux =
67 Eigen::VectorXd::Zero(laplacian_matrix.rows());
68
69 for (std::size_t ip = 0; ip < ip_flux_vector.size(); ++ip)
70 {
71 auto const& ip_data = ip_data_vector[ip];
72 auto const w = ip_data.integration_weight;
73 auto const& dNdx = ip_data.dNdx;
74
75 quasi_nodal_flux.noalias() -= ip_flux_vector[ip].transpose() * dNdx * w;
76 }
77
78 applyFullUpwind(quasi_nodal_flux, laplacian_matrix);
79}
void applyFullUpwind(Eigen::VectorXd const &quasi_nodal_flux, Eigen::MatrixBase< Derived > &laplacian_matrix)

References applyFullUpwind().

◆ assembleAdvectionMatrix()

template<typename IPData , typename FluxVectorType , typename Derived >
void NumLib::detail::assembleAdvectionMatrix ( IPData const &  ip_data_vector,
std::vector< FluxVectorType > const &  ip_flux_vector,
Eigen::MatrixBase< Derived > &  laplacian_matrix 
)

◆ calculateFluxCorrectedTransport()

void NumLib::detail::calculateFluxCorrectedTransport ( const double  t,
const double  dt,
std::vector< GlobalVector * > const &  x,
std::vector< GlobalVector * > const &  x_prev,
int const  process_id,
const MathLib::MatrixSpecifications matrix_specification,
GlobalMatrix M,
GlobalMatrix K,
GlobalVector b 
)

Definition at line 34 of file FluxCorrectedTransport.h.

42{
43#ifndef USE_PETSC
44 auto D = newZeroedInstance<GlobalMatrix>(matrix_specification);
45 auto F = newZeroedInstance<GlobalMatrix>(matrix_specification);
46
47 // compute artificial diffusion operator D
48 using RawMatrixType = Eigen::SparseMatrix<double, Eigen::RowMajor>;
49 auto& K_raw = K.getRawMatrix();
50 K_raw *= -1;
51 for (int k = 0; k < K_raw.outerSize(); ++k)
52 {
53 for (RawMatrixType::InnerIterator it(K_raw, k); it; ++it)
54 {
55 if (it.row() != it.col())
56 {
57 double const kij = it.value();
58 double const kji = K.get(it.col(), it.row());
59 double const dij = std::max({-kij, 0., -kji});
60 D->setValue(it.row(), it.col(), dij);
61 }
62 }
63 }
64 auto& D_raw = D->getRawMatrix();
65 D_raw -= (D_raw * Eigen::VectorXd::Ones(D_raw.cols())).eval().asDiagonal();
66
67 // compute F
68 for (int k = 0; k < D_raw.outerSize(); ++k)
69 {
70 for (RawMatrixType::InnerIterator it(D_raw, k); it; ++it)
71 {
72 double const dij = it.value();
73 double const xj = x[process_id]->get(it.col());
74 double const xi = x[process_id]->get(it.row());
75 double const fij = -dij * (xj - xi);
76 F->setValue(it.row(), it.col(), fij);
77 }
78 }
79
80 auto& M_raw = M.getRawMatrix();
81 for (int k = 0; k < M_raw.outerSize(); ++k)
82 {
83 for (RawMatrixType::InnerIterator it(M_raw, k); it; ++it)
84 {
85 double const mij = it.value();
86 double const xdotj = (x[process_id]->get(it.col()) -
87 x_prev[process_id]->get(it.col())) /
88 dt;
89 double const xdoti = (x[process_id]->get(it.row()) -
90 x_prev[process_id]->get(it.row())) /
91 dt;
92 double const fij = -mij * (xdotj - xdoti);
93 F->add(it.row(), it.col(), fij);
94 }
95 }
96
97 auto P_plus = newZeroedInstance<GlobalVector>(matrix_specification);
98 auto P_minus = newZeroedInstance<GlobalVector>(matrix_specification);
99 auto Q_plus = newZeroedInstance<GlobalVector>(matrix_specification);
100 auto Q_minus = newZeroedInstance<GlobalVector>(matrix_specification);
101 auto R_plus = newZeroedInstance<GlobalVector>(matrix_specification);
102 auto R_minus = newZeroedInstance<GlobalVector>(matrix_specification);
103
104 auto& F_raw = F->getRawMatrix();
105 for (int k = 0; k < F_raw.outerSize(); ++k)
106 {
107 for (RawMatrixType::InnerIterator it(F_raw, k); it; ++it)
108 {
109 if (it.row() != it.col())
110 {
111 double const fij = it.value();
112 P_plus->add(it.row(), std::max(0., fij));
113 P_minus->add(it.row(), std::min(0., fij));
114
115 double const x_prev_i = x_prev[process_id]->get(it.row());
116 double const x_prev_j = x_prev[process_id]->get(it.col());
117
118 double const Q_plus_i = Q_plus->get(it.row());
119 double Q_plus_i_tmp =
120 std::max({Q_plus_i, 0., x_prev_j - x_prev_i});
121 Q_plus->set(it.row(), Q_plus_i_tmp);
122
123 double const Q_minus_i = Q_minus->get(it.row());
124 double Q_minus_i_tmp =
125 std::min({Q_minus_i, 0., x_prev_j - x_prev_i});
126 Q_minus->set(it.row(), Q_minus_i_tmp);
127 }
128 }
129 }
130
131 Eigen::VectorXd const M_L =
132 (M_raw * Eigen::VectorXd::Ones(M_raw.cols())).eval();
133 for (auto k = R_plus->getRangeBegin(); k < R_plus->getRangeEnd(); ++k)
134 {
135 double const mi = M_L(k);
136 double const Q_plus_i = Q_plus->get(k);
137 double const P_plus_i = P_plus->get(k);
138
139 double const tmp =
140 P_plus_i == 0. ? 0.0 : std::min(1.0, mi * Q_plus_i / dt / P_plus_i);
141
142 R_plus->set(k, tmp);
143 }
144
145 for (auto k = R_minus->getRangeBegin(); k < R_minus->getRangeEnd(); ++k)
146 {
147 double const mi = M_L(k);
148 double const Q_minus_i = Q_minus->get(k);
149 double const P_minus_i = P_minus->get(k);
150
151 double const tmp = P_minus_i == 0.
152 ? 0.0
153 : std::min(1.0, mi * Q_minus_i / dt / P_minus_i);
154 R_minus->set(k, tmp);
155 }
156
157 auto alpha = newZeroedInstance<GlobalMatrix>(matrix_specification);
158 for (int k = 0; k < F_raw.outerSize(); ++k)
159 {
160 for (RawMatrixType::InnerIterator it(F_raw, k); it; ++it)
161 {
162 double const fij = it.value();
163 if (fij > 0.)
164 {
165 double const R_plus_i = R_plus->get(it.row());
166 double const R_minus_j = R_minus->get(it.col());
167 double const alpha_ij = std::min(R_plus_i, R_minus_j);
168
169 alpha->setValue(it.row(), it.col(), alpha_ij);
170 }
171 else
172 {
173 double const R_minus_i = R_minus->get(it.row());
174 double const R_plus_j = R_plus->get(it.col());
175 double const alpha_ij = std::min(R_minus_i, R_plus_j);
176
177 alpha->setValue(it.row(), it.col(), alpha_ij);
178 }
179 }
180 }
181
182 // compute limited antidiffusive fluxes
183 for (int k = 0; k < F_raw.outerSize(); ++k)
184 {
185 for (RawMatrixType::InnerIterator it(F_raw, k); it; ++it)
186 {
187 if (it.row() != it.col())
188 {
189 double const fij = it.value();
190 double const alpha_ij = alpha->get(it.row(), it.col());
191
192 b.add(it.row(), alpha_ij * fij);
193 }
194 }
195 }
196
197 // compute low-order operator
198 K_raw += D_raw;
199 K_raw *= -1;
200
201 // overwrite with the lumped mass matrix
202 M.setZero();
203 for (int k = 0; k < M.getNumberOfRows(); ++k)
204 {
205 M.setValue(k, k, M_L(k));
206 }
207#endif // end of ifndef USE_PETSC
208}
void setZero()
reset data entries to zero.
Definition: EigenMatrix.h:64
IndexType getNumberOfRows() const
return the number of rows
Definition: EigenMatrix.h:52
int setValue(IndexType row, IndexType col, double val)
Definition: EigenMatrix.h:76
double get(IndexType row, IndexType col) const
get value. This function returns zero if the element doesn't exist.
Definition: EigenMatrix.h:130
RawMatrixType & getRawMatrix()
Definition: EigenMatrix.h:144
void add(IndexType rowId, double v)
add entry
Definition: EigenVector.h:76
auto & get(Tuples &... ts)
Definition: Get.h:57
auto eval(Function &f, Tuples &... ts) -> typename detail::GetFunctionReturnType< decltype(&Function::eval)>::type
Definition: Apply.h:267

Referenced by NumLib::computeFluxCorrectedTransport().

◆ checkJacobianDeterminant()

static void NumLib::detail::checkJacobianDeterminant ( const double  detJ,
MeshLib::Element const &  element 
)
static

Definition at line 92 of file NaturalCoordinatesMapping.cpp.

94{
95 if (detJ > 0)
96 { // The usual case
97 return;
98 }
99
100 if (detJ < 0)
101 {
102 ERR("det J = {:g} is negative for element {:d}.",
103 detJ,
104 element.getID());
105#ifndef NDEBUG
106 std::cerr << element << "\n";
107#endif // NDEBUG
108 OGS_FATAL(
109 "Please check whether the node numbering of the element is correct,"
110 "or additional elements (like boundary elements) are still present "
111 "in the mesh.");
112 }
113
114 if (detJ == 0)
115 {
116 ERR("det J is zero for element {:d}.", element.getID());
117#ifndef NDEBUG
118 std::cerr << element << "\n";
119#endif // NDEBUG
120 OGS_FATAL(
121 "Please check whether:\n"
122 "\t the element nodes may have the same coordinates,\n"
123 "\t or the coordinates of all nodes are not given on the x-axis "
124 "for a 1D problem or in the xy-plane in the 2D case.\n"
125 "The first case can occur, if not all boundary elements"
126 "were removed from the bulk mesh.");
127 }
128}
#define OGS_FATAL(...)
Definition: Error.h:26
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:45

References ERR(), MeshLib::Element::getID(), and OGS_FATAL.

Referenced by computeMappingMatrices().

◆ computeMappingMatrices() [1/6]

template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void NumLib::detail::computeMappingMatrices ( const MeshLib::Element ,
const double *  natural_pt,
const MeshLib::ElementCoordinatesMappingLocal ,
T_SHAPE_MATRICES &  shapemat,
FieldType< ShapeMatrixType::DNDR  
)
inline

Definition at line 78 of file NaturalCoordinatesMapping.cpp.

84{
85 if constexpr (T_SHAPE_FUNC::DIM != 0)
86 {
87 double* const dNdr = shapemat.dNdr.data();
88 T_SHAPE_FUNC::computeGradShapeFunction(natural_pt, dNdr);
89 }
90}

◆ computeMappingMatrices() [2/6]

template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void NumLib::detail::computeMappingMatrices ( const MeshLib::Element ,
const double *  natural_pt,
const MeshLib::ElementCoordinatesMappingLocal ,
T_SHAPE_MATRICES &  shapemat,
FieldType< ShapeMatrixType::N  
)
inline

Definition at line 67 of file NaturalCoordinatesMapping.cpp.

73{
74 T_SHAPE_FUNC::computeShapeFunction(natural_pt, shapemat.N);
75}

◆ computeMappingMatrices() [3/6]

template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void NumLib::detail::computeMappingMatrices ( const MeshLib::Element ele,
const double *  natural_pt,
const MeshLib::ElementCoordinatesMappingLocal ele_local_coord,
T_SHAPE_MATRICES &  shapemat,
FieldType< ShapeMatrixType::ALL  
)
inline

Definition at line 243 of file NaturalCoordinatesMapping.cpp.

249{
250 computeMappingMatrices<T_SHAPE_FUNC, T_SHAPE_MATRICES>(
251 ele,
252 natural_pt,
253 ele_local_coord,
254 shapemat,
256 computeMappingMatrices<T_SHAPE_FUNC, T_SHAPE_MATRICES>(
257 ele,
258 natural_pt,
259 ele_local_coord,
260 shapemat,
262}

◆ computeMappingMatrices() [4/6]

template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void NumLib::detail::computeMappingMatrices ( const MeshLib::Element ele,
const double *  natural_pt,
const MeshLib::ElementCoordinatesMappingLocal ele_local_coord,
T_SHAPE_MATRICES &  shapemat,
FieldType< ShapeMatrixType::DNDR_J  
)
inline

Definition at line 131 of file NaturalCoordinatesMapping.cpp.

137{
138 if constexpr (T_SHAPE_FUNC::DIM != 0)
139 {
140 computeMappingMatrices<T_SHAPE_FUNC, T_SHAPE_MATRICES>(
141 ele,
142 natural_pt,
143 ele_local_coord,
144 shapemat,
146
147 auto const dim = T_SHAPE_FUNC::DIM;
148 auto const nnodes = T_SHAPE_FUNC::NPOINTS;
149
150 // jacobian: J=[dx/dr dy/dr // dx/ds dy/ds]
151 for (auto k = decltype(nnodes){0}; k < nnodes; k++)
152 {
153 const MathLib::Point3d& mapped_pt =
154 ele_local_coord.getMappedCoordinates(k);
155 // outer product of dNdr and mapped_pt for a particular node
156 for (auto i_r = decltype(dim){0}; i_r < dim; i_r++)
157 {
158 for (auto j_x = decltype(dim){0}; j_x < dim; j_x++)
159 {
160 shapemat.J(i_r, j_x) +=
161 shapemat.dNdr(i_r, k) * mapped_pt[j_x];
162 }
163 }
164 }
165
166 shapemat.detJ = shapemat.J.determinant();
167 checkJacobianDeterminant(shapemat.detJ, ele);
168 }
169 else
170 {
171 shapemat.detJ = 1.0;
172 }
173}
MathLib::Point3d const & getMappedCoordinates(std::size_t node_id) const
return mapped coordinates of the node
static void checkJacobianDeterminant(const double detJ, MeshLib::Element const &element)

References checkJacobianDeterminant(), and MeshLib::ElementCoordinatesMappingLocal::getMappedCoordinates().

◆ computeMappingMatrices() [5/6]

template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void NumLib::detail::computeMappingMatrices ( const MeshLib::Element ele,
const double *  natural_pt,
const MeshLib::ElementCoordinatesMappingLocal ele_local_coord,
T_SHAPE_MATRICES &  shapemat,
FieldType< ShapeMatrixType::DNDX  
)
inline

Definition at line 198 of file NaturalCoordinatesMapping.cpp.

204{
205 computeMappingMatrices<T_SHAPE_FUNC, T_SHAPE_MATRICES>(
206 ele,
207 natural_pt,
208 ele_local_coord,
209 shapemat,
211 if constexpr (T_SHAPE_FUNC::DIM != 0)
212 {
213 checkJacobianDeterminant(shapemat.detJ, ele);
214
215 // J^-1, dshape/dx
216 shapemat.invJ.noalias() = shapemat.J.inverse();
217
218 assert(shapemat.dNdr.rows() == ele.getDimension());
219 const unsigned global_dim = ele_local_coord.getGlobalDimension();
220 if (global_dim == T_SHAPE_FUNC::DIM)
221 {
222 shapemat.dNdx
223 .template topLeftCorner<T_SHAPE_FUNC::DIM,
224 T_SHAPE_FUNC::NPOINTS>()
225 .noalias() = shapemat.invJ * shapemat.dNdr;
226 }
227 else
228 {
229 auto const& matR =
230 (ele_local_coord.getRotationMatrixToGlobal().topLeftCorner(
231 global_dim, T_SHAPE_FUNC::DIM))
232 .eval();
233
234 auto const invJ_dNdr = shapemat.invJ * shapemat.dNdr;
235 auto const dshape_global = matR * invJ_dNdr;
236 shapemat.dNdx =
237 dshape_global.topLeftCorner(global_dim, T_SHAPE_FUNC::NPOINTS);
238 }
239 }
240}
const RotationMatrix & getRotationMatrixToGlobal() const
return a rotation matrix converting to global coordinates
unsigned getGlobalDimension() const
return the global dimension
virtual constexpr unsigned getDimension() const =0
Get dimension of the mesh element.

References checkJacobianDeterminant(), MeshLib::Element::getDimension(), MeshLib::ElementCoordinatesMappingLocal::getGlobalDimension(), and MeshLib::ElementCoordinatesMappingLocal::getRotationMatrixToGlobal().

◆ computeMappingMatrices() [6/6]

template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES >
void NumLib::detail::computeMappingMatrices ( const MeshLib::Element ele,
const double *  natural_pt,
const MeshLib::ElementCoordinatesMappingLocal ele_local_coord,
T_SHAPE_MATRICES &  shapemat,
FieldType< ShapeMatrixType::N_J  
)
inline

Definition at line 176 of file NaturalCoordinatesMapping.cpp.

182{
183 computeMappingMatrices<T_SHAPE_FUNC, T_SHAPE_MATRICES>(
184 ele,
185 natural_pt,
186 ele_local_coord,
187 shapemat,
189 computeMappingMatrices<T_SHAPE_FUNC, T_SHAPE_MATRICES>(
190 ele,
191 natural_pt,
192 ele_local_coord,
193 shapemat,
195}

◆ getHydrodynamicDispersion()

Eigen::MatrixXd NumLib::detail::getHydrodynamicDispersion ( Eigen::MatrixXd const &  pore_diffusion_coefficient,
Eigen::VectorXd const &  velocity,
double const  porosity,
double const  solute_dispersivity_transverse,
double const  solute_dispersivity_longitudinal 
)
inline

Definition at line 21 of file HydrodynamicDispersion.h.

27{
28 double const velocity_magnitude = velocity.norm();
29 if (velocity_magnitude == 0.0)
30 {
31 return porosity * pore_diffusion_coefficient;
32 }
33
34 auto const dim = velocity.size();
35 Eigen::MatrixXd const& I(Eigen::MatrixXd::Identity(dim, dim));
36 return porosity * pore_diffusion_coefficient +
37 solute_dispersivity_transverse * velocity_magnitude * I +
38 (solute_dispersivity_longitudinal - solute_dispersivity_transverse) /
39 velocity_magnitude * velocity * velocity.transpose();
40}

Referenced by NumLib::computeHydrodynamicDispersion().

◆ getHydrodynamicDispersionWithArtificialDiffusion()

Eigen::MatrixXd NumLib::detail::getHydrodynamicDispersionWithArtificialDiffusion ( IsotropicDiffusionStabilization const &  stabilizer,
std::size_t const  element_id,
Eigen::MatrixXd const &  pore_diffusion_coefficient,
Eigen::VectorXd const &  velocity,
double const  porosity,
double const  solute_dispersivity_transverse,
double const  solute_dispersivity_longitudinal 
)
inline

Definition at line 42 of file HydrodynamicDispersion.h.

50{
51 double const velocity_magnitude = velocity.norm();
52 if (velocity_magnitude == 0.0)
53 {
54 return porosity * pore_diffusion_coefficient;
55 }
56
57 double const artificial_diffusion =
58 stabilizer.computeArtificialDiffusion(element_id, velocity_magnitude);
59
60 auto const dim = velocity.size();
61 Eigen::MatrixXd const& I(Eigen::MatrixXd::Identity(dim, dim));
62 return porosity * pore_diffusion_coefficient +
63 (solute_dispersivity_transverse * velocity_magnitude +
64 artificial_diffusion) *
65 I +
66 (solute_dispersivity_longitudinal - solute_dispersivity_transverse) /
67 velocity_magnitude * velocity * velocity.transpose();
68}

References NumLib::IsotropicDiffusionStabilization::computeArtificialDiffusion().

Referenced by NumLib::computeHydrodynamicDispersion().

◆ getScalarOrVectorComponent()

template<std::size_t IndexInTuple, typename Tuple >
double NumLib::detail::getScalarOrVectorComponent ( Tuple const &  tuple,
Eigen::Index  component 
)

Definition at line 39 of file NumericalDifferentiation.h.

40{
41 auto const& value = std::get<IndexInTuple>(tuple);
42
43 if constexpr (IsScalar<std::remove_cvref_t<decltype(value)>>::value)
44 {
45 return value;
46 }
47 else
48 {
49 return value[component];
50 }
51}

◆ localDOFImpl()

template<typename... Ns_t, typename ElementDOFVector , int... Offsets, int... Sizes>
auto NumLib::detail::localDOFImpl ( ElementDOFVector const &  x,
boost::mp11::mp_list_c< int, Offsets... >  ,
boost::mp11::mp_list_c< int, Sizes... >   
)

Definition at line 42 of file LocalDOF.h.

45{
46 static_assert(((Sizes > 0) && ...));
47 static_assert(((Offsets >= 0) && ...));
48
49 return std::tuple<Eigen::Map<typename MatrixPolicyType::VectorType<
50 NumberOfDofs<Ns_t>::value> const>...>{{x.data() + Offsets, Sizes}...};
51}
typename ::detail::EigenMatrixType< N, 1 >::type VectorType

Referenced by NumLib::localDOF().

◆ naturalCoordinatesMappingComputeShapeMatrices()

template<class T_SHAPE_FUNC , class T_SHAPE_MATRICES , ShapeMatrixType T_SHAPE_MATRIX_TYPE>
void NumLib::detail::naturalCoordinatesMappingComputeShapeMatrices ( const MeshLib::Element ele,
const double *  natural_pt,
T_SHAPE_MATRICES &  shapemat,
const unsigned  global_dim 
)

Used to explicitly instantiate the NaturalCoordinatesMapping class template.

Definition at line 267 of file NaturalCoordinatesMapping.cpp.

271{
272 const MeshLib::ElementCoordinatesMappingLocal ele_local_coord(ele,
273 global_dim);
274
275 detail::computeMappingMatrices<T_SHAPE_FUNC, T_SHAPE_MATRICES>(
276 ele,
277 natural_pt,
278 ele_local_coord,
279 shapemat,
281}

Referenced by NumLib::NaturalCoordinatesMapping< T_SHAPE_FUNC, T_SHAPE_MATRICES >::computeShapeMatrices().

◆ newZeroedInstance()

template<typename MatrixVectorType >
std::unique_ptr< MatrixVectorType > NumLib::detail::newZeroedInstance ( MathLib::MatrixSpecifications const &  matrix_specification)

Definition at line 25 of file FluxCorrectedTransport.h.

27{
29 matrix_specification);
30 result->setZero();
31 return result;
32}

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [1/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeHex20  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [2/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeHex8  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [3/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeLine2  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [4/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeLine3  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [5/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapePoint1  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [6/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapePrism15  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [7/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapePrism6  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [8/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapePyra13  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [9/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapePyra5  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [10/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeQuad4  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [11/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeQuad8  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [12/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeQuad9  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [13/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeTet10  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [14/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeTet4  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [15/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeTri3  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN() [16/16]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_DYN ( ShapeTri6  )

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [1/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeHex20  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [2/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeHex20  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [3/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeHex20  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [4/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeHex8  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [5/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeHex8  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [6/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeHex8  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [7/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeLine2  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [8/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeLine2  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [9/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeLine2  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [10/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeLine3  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [11/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeLine3  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [12/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeLine3  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [13/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePoint1  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [14/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePoint1  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [15/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePoint1  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [16/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePrism15  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [17/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePrism15  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [18/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePrism15  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [19/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePrism6  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [20/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePrism6  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [21/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePrism6  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [22/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePyra13  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [23/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePyra13  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [24/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePyra13  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [25/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePyra5  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [26/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePyra5  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [27/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapePyra5  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [28/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeQuad4  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [29/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeQuad4  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [30/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeQuad4  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [31/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeQuad8  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [32/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeQuad8  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [33/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeQuad8  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [34/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeQuad9  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [35/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeQuad9  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [36/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeQuad9  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [37/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTet10  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [38/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTet10  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [39/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTet10  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [40/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTet4  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [41/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTet4  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [42/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTet4  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [43/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTri3  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [44/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTri3  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [45/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTri3  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [46/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTri6  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [47/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTri6  ,
 
)

◆ OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX() [48/48]

NumLib::detail::OGS_INSTANTIATE_NATURAL_COORDINATES_MAPPING_FIX ( ShapeTri6  ,
 
)

◆ setMatrixZero()

template<class T >
void NumLib::detail::setMatrixZero ( T &  mat)

Definition at line 21 of file ShapeMatrices-impl.h.

22{
23 // mat.setZero();
24 const std::size_t n = mat.rows() * mat.cols();
25 auto* v = mat.data();
26 for (std::size_t i = 0; i < n; i++)
27 {
28 v[i] = .0;
29 }
30}

Referenced by setZero().

◆ setVectorZero()

template<class T >
void NumLib::detail::setVectorZero ( T &  vec)

Definition at line 33 of file ShapeMatrices-impl.h.

34{
35 // vec.setZero();
36 const std::size_t n = vec.size();
37 auto* v = vec.data();
38 for (std::size_t i = 0; i < n; i++)
39 {
40 v[i] = .0;
41 }
42}

Referenced by setZero().

◆ setZero() [1/6]

template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void NumLib::detail::setZero ( ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &  shape,
ShapeDataFieldType< ShapeMatrixType::ALL  
)
inline

Definition at line 95 of file ShapeMatrices-impl.h.

97{
100}
void setZero(ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape, ShapeDataFieldType< ShapeMatrixType::N >)

References setZero().

◆ setZero() [2/6]

template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void NumLib::detail::setZero ( ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &  shape,
ShapeDataFieldType< ShapeMatrixType::DNDR  
)
inline

Definition at line 61 of file ShapeMatrices-impl.h.

63{
64 setMatrixZero(shape.dNdr);
65}
void setMatrixZero(T &mat)

References NumLib::ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX >::dNdr, and setMatrixZero().

◆ setZero() [3/6]

template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void NumLib::detail::setZero ( ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &  shape,
ShapeDataFieldType< ShapeMatrixType::DNDR_J  
)
inline

◆ setZero() [4/6]

template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void NumLib::detail::setZero ( ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &  shape,
ShapeDataFieldType< ShapeMatrixType::DNDX  
)
inline

◆ setZero() [5/6]

template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void NumLib::detail::setZero ( ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &  shape,
ShapeDataFieldType< ShapeMatrixType::N  
)
inline

Definition at line 54 of file ShapeMatrices-impl.h.

56{
57 setVectorZero(shape.N);
58}
void setVectorZero(T &vec)
ShapeType N
Vector of shape functions, N(r)
Definition: ShapeMatrices.h:51

References NumLib::ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX >::N, and setVectorZero().

Referenced by NumLib::ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX >::setZero(), and setZero().

◆ setZero() [6/6]

template<class T_N , class T_DNDR , class T_J , class T_DNDX >
void NumLib::detail::setZero ( ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &  shape,
ShapeDataFieldType< ShapeMatrixType::N_J  
)
inline

Definition at line 78 of file ShapeMatrices-impl.h.

References setZero().

◆ shapeFunctionInterpolate() [1/2]

template<unsigned DOFOffset, typename NodalValues , typename ShapeMatrix >
void NumLib::detail::shapeFunctionInterpolate ( const NodalValues &  ,
const ShapeMatrix &   
)
See also
NumLib::shapeFunctionInterpolate()

Definition at line 27 of file Interpolation.h.

29{
30}

Referenced by ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, GlobalDim >::assemble(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::assemble(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::VariableDependentNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleBlockMatrices(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleHeatTransportEquation(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::assembleHeatTransportEquation(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::assembleHydraulicEquation(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleMatrixAndVector(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleReactionEquationConcrete(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::calculateIntPtDarcyVelocity(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::computeProjectedDarcyVelocity(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::TES::TESLocalAssembler< ShapeFunction_, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocityLocal(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtSaturation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::initializeChemicalSystemConcrete(), ProcessLib::TES::TESLocalAssemblerInner< Traits >::preEachAssembleIntegrationPoint(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::setChemicalSystemConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::setInitialConditionsConcrete(), and ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::setInitialConditionsConcrete().

◆ shapeFunctionInterpolate() [2/2]

template<unsigned DOFOffset, typename NodalValues , typename ShapeMatrix , typename... ScalarTypes>
void NumLib::detail::shapeFunctionInterpolate ( const NodalValues &  nodal_values,
const ShapeMatrix &  shape_matrix_N,
double &  interpolated_value,
ScalarTypes &...  interpolated_values 
)
See also
NumLib::shapeFunctionInterpolate()

Definition at line 35 of file Interpolation.h.

39{
40 auto const num_nodes = shape_matrix_N.size();
41 double iv = 0.0;
42
43 for (auto n = decltype(num_nodes){0}; n < num_nodes; ++n)
44 {
45 iv += nodal_values[DOFOffset * num_nodes + n] * shape_matrix_N[n];
46 }
47
48 interpolated_value = iv;
49
50 shapeFunctionInterpolate<DOFOffset + 1>(nodal_values, shape_matrix_N,
51 interpolated_values...);
52}

◆ solvePicard()

bool NumLib::detail::solvePicard ( GlobalLinearSolver linear_solver,
GlobalMatrix A,
GlobalVector rhs,
GlobalVector x,
bool const  compute_necessary 
)

Definition at line 59 of file NonlinearSolver.cpp.

62{
63 if (!compute_necessary)
64 {
65 WARN(
66 "The performance optimization to skip the linear solver compute() "
67 "step is not implemented for PETSc or LIS linear solvers.");
68 }
69
70 BaseLib::RunTime time_linear_solver;
71 time_linear_solver.start();
72
73 bool const iteration_succeeded = linear_solver.solve(A, rhs, x);
74
75 INFO("[time] Linear solver took {:g} s.", time_linear_solver.elapsed());
76
77 if (iteration_succeeded)
78 {
79 return true;
80 }
81
82 ERR("Picard: The linear solver failed in the solve() step.");
83 return false;
84}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:35
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:40
Count the running time.
Definition: RunTime.h:29
double elapsed() const
Get the elapsed time in seconds.
Definition: RunTime.h:42
void start()
Start the timer.
Definition: RunTime.h:32
bool solve(EigenMatrix &A, EigenVector &b, EigenVector &x)

References BaseLib::RunTime::elapsed(), ERR(), INFO(), MathLib::EigenLisLinearSolver::solve(), BaseLib::RunTime::start(), and WARN().

Referenced by NumLib::NonlinearSolver< NonlinearSolverTag::Picard >::solve().