OGS
detail Namespace Reference

Classes

struct  EigenMatrixType
struct  EigenMatrixType< 0, 1 >
struct  EigenMatrixType< 0, M >
struct  EigenMatrixType< N, 1 >

Functions

void rotateToLocal (const MeshLib::RotationMatrix &matR2local, std::vector< MathLib::Point3d > &points)
 rotate points to local coordinates
MeshLib::RotationMatrix getRotationMatrixToGlobal (const unsigned element_dimension, const unsigned global_dim, const std::vector< MathLib::Point3d > &points)
template<typename Solutions, typename Vector>
void applyKnownSolutions (std::vector< Solutions > const *const known_solutions, Vector &x)
 Applies known solutions to the solution vector x.

Function Documentation

◆ applyKnownSolutions()

template<typename Solutions, typename Vector>
void detail::applyKnownSolutions ( std::vector< Solutions > const *const known_solutions,
Vector & x )

Applies known solutions to the solution vector x.

Definition at line 18 of file TimeDiscretizedODESystem.cpp.

20{
21 if (!known_solutions)
22 {
23 return;
24 }
25
26 for (auto const& bc : *known_solutions)
27 {
28 for (std::size_t i = 0; i < bc.ids.size(); ++i)
29 {
30 // TODO that might have bad performance for some Vector types, e.g.,
31 // PETSc.
32 MathLib::setVector(x, bc.ids[i], bc.values[i]);
33 }
34 }
36}
void finalizeAssembly(PETScMatrix &A)
Definition LinAlg.cpp:191
void setVector(PETScVector &v, std::initializer_list< double > values)

References MathLib::LinAlg::finalizeAssembly(), and MathLib::setVector().

Referenced by NumLib::TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >::applyKnownSolutions(), and NumLib::TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >::applyKnownSolutions().

◆ getRotationMatrixToGlobal()

MeshLib::RotationMatrix detail::getRotationMatrixToGlobal ( const unsigned element_dimension,
const unsigned global_dim,
const std::vector< MathLib::Point3d > & points )

get a rotation matrix to the global coordinates it computes R in x=R*x' where x is original coordinates and x' is local coordinates

Definition at line 28 of file ElementCoordinatesMappingLocal.cpp.

32{
33 Eigen::Matrix3d matR;
34 // compute R in x=R*x' where x are original coordinates and x' are local
35 // coordinates
36 if (element_dimension == 1)
37 {
38 Eigen::Vector3d const xx =
39 (points[1].asEigenVector3d() - points[0].asEigenVector3d())
40 .normalized();
41 if (global_dim == 2)
42 {
44 }
45 else
46 {
48 }
49 matR.transposeInPlace();
50 }
51 else if (global_dim == 3 && element_dimension == 2)
52 {
53 // get plane normal
54 auto const [plane_normal, d] = GeoLib::getNewellPlane(points);
55 // compute a rotation matrix to XY
56 matR = GeoLib::computeRotationMatrixToXY(plane_normal);
57 // set a transposed matrix
58 matR.transposeInPlace();
59 }
60 return matR;
61}
Eigen::Matrix3d compute3DRotationMatrixToX(Eigen::Vector3d const &v)
Eigen::Matrix3d computeRotationMatrixToXY(Eigen::Vector3d const &n)
std::pair< Eigen::Vector3d, double > getNewellPlane(InputIterator pnts_begin, InputIterator pnts_end)
Eigen::Matrix3d compute2DRotationMatrixToX(Eigen::Vector3d const &v)

References GeoLib::compute2DRotationMatrixToX(), GeoLib::compute3DRotationMatrixToX(), GeoLib::computeRotationMatrixToXY(), and GeoLib::getNewellPlane().

Referenced by MeshLib::ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal().

◆ rotateToLocal()

void detail::rotateToLocal ( const MeshLib::RotationMatrix & matR2local,
std::vector< MathLib::Point3d > & points )

rotate points to local coordinates

Definition at line 18 of file ElementCoordinatesMappingLocal.cpp.

20{
21 std::transform(points.begin(), points.end(), points.begin(),
22 [&matR2local](auto const& pnt) { return matR2local * pnt; });
23}

Referenced by MeshLib::ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal().