v0.16.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
BasicPostProcFatPrism Struct Reference

Core broken-mesh post-processor adapted to the fat-prism element. More...

#include "users_modules/basic_finite_elements/src/BasicPostProc.hpp"

Inheritance diagram for BasicPostProcFatPrism:
[legend]
Collaboration diagram for BasicPostProcFatPrism:
[legend]

Public Types

using Base = PostProcBrokenMeshInMoabBase< FatPrismElementForcesAndSourcesCore >
 

Public Member Functions

int getRuleTrianglesOnly (int) override
 
int getRuleThroughThickness (int) override
 
MoFEMErrorCode setGaussPtsTrianglesOnly (int order) override
 
MoFEMErrorCode setGaussPtsThroughThickness (int) override
 

Detailed Description

Core broken-mesh post-processor adapted to the fat-prism element.

FatPrismElementForcesAndSourcesCore builds its integration points as a Cartesian product of points on a triangle and points through the prism thickness. The core post-processor stores the same points as one reference prism. This adapter exposes that reference-prism point set in the form expected by the fat-prism element and keeps the point-to-vertex map in the resulting Cartesian-product order.

Examples
mofem/users_modules/basic_finite_elements/elasticity/elasticity.cpp.

Definition at line 18 of file BasicPostProc.hpp.

Member Typedef Documentation

◆ Base

using BasicPostProcFatPrism::Base = PostProcBrokenMeshInMoabBase<FatPrismElementForcesAndSourcesCore>

Definition at line 22 of file BasicPostProc.hpp.

Member Function Documentation

◆ getRuleThroughThickness()

int BasicPostProcFatPrism::getRuleThroughThickness ( int  )
inlineoverride

Definition at line 27 of file BasicPostProc.hpp.

27{ return -1; }

◆ getRuleTrianglesOnly()

int BasicPostProcFatPrism::getRuleTrianglesOnly ( int  )
inlineoverride

Definition at line 26 of file BasicPostProc.hpp.

26{ return -1; }

◆ setGaussPtsThroughThickness()

MoFEMErrorCode BasicPostProcFatPrism::setGaussPtsThroughThickness ( int  )
inlineoverride

Definition at line 105 of file BasicPostProc.hpp.

105 {
107 if (!this->gaussPtsThroughThickness.size2())
108 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
109 "Fat-prism post-processing points are not initialised");
111 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()

◆ setGaussPtsTrianglesOnly()

MoFEMErrorCode BasicPostProcFatPrism::setGaussPtsTrianglesOnly ( int  order)
inlineoverride

Definition at line 29 of file BasicPostProc.hpp.

29 {
31
32 CHKERR Base::setGaussPts(order);
33
34 constexpr double eps = 100 * std::numeric_limits<double>::epsilon();
35 std::vector<std::array<double, 2>> triangle_points;
36 std::vector<double> thickness_points;
37
38 auto same = [eps](const double a, const double b) {
39 return std::abs(a - b) <= eps;
40 };
41 auto has_triangle_point = [&](const double ksi, const double eta) {
42 return std::find_if(
43 triangle_points.begin(), triangle_points.end(),
44 [&](const auto &p) {
45 return same(p[0], ksi) && same(p[1], eta);
46 }) != triangle_points.end();
47 };
48 auto has_thickness_point = [&](const double zeta) {
49 return std::find_if(thickness_points.begin(), thickness_points.end(),
50 [&](const double z) { return same(z, zeta); }) !=
51 thickness_points.end();
52 };
53
54 const auto reference_points = this->gaussPts;
55 const auto original_map = this->mapGaussPts;
56 for (size_t gg = 0; gg != reference_points.size2(); ++gg) {
57 const double ksi = reference_points(0, gg);
58 const double eta = reference_points(1, gg);
59 const double zeta = reference_points(2, gg);
60 if (!has_triangle_point(ksi, eta))
61 triangle_points.push_back({ksi, eta});
62 if (!has_thickness_point(zeta))
63 thickness_points.push_back(zeta);
64 }
65
66 const size_t expected_points =
67 triangle_points.size() * thickness_points.size();
68 if (expected_points != reference_points.size2())
69 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
70 "Reference prism points do not form a Cartesian product");
71
72 this->gaussPtsTrianglesOnly.resize(3, triangle_points.size(), false);
73 this->gaussPtsTrianglesOnly.clear();
74 for (size_t tt = 0; tt != triangle_points.size(); ++tt) {
75 this->gaussPtsTrianglesOnly(0, tt) = triangle_points[tt][0];
76 this->gaussPtsTrianglesOnly(1, tt) = triangle_points[tt][1];
77 }
78
79 this->gaussPtsThroughThickness.resize(2, thickness_points.size(), false);
80 this->gaussPtsThroughThickness.clear();
81 for (size_t zz = 0; zz != thickness_points.size(); ++zz)
82 this->gaussPtsThroughThickness(0, zz) = thickness_points[zz];
83
84 this->mapGaussPts.clear();
85 this->mapGaussPts.reserve(expected_points);
86 for (const auto &p : triangle_points) {
87 for (const double zeta : thickness_points) {
88 auto gg = size_t{0};
89 for (; gg != reference_points.size2(); ++gg) {
90 if (same(reference_points(0, gg), p[0]) &&
91 same(reference_points(1, gg), p[1]) &&
92 same(reference_points(2, gg), zeta))
93 break;
94 }
95 if (gg == reference_points.size2())
96 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
97 "Could not map a fat-prism post-processing point");
98 this->mapGaussPts.push_back(original_map[gg]);
99 }
100 }
101
103 }
constexpr double a
static const double eps
#define CHKERR
Inline error check.
constexpr int order
double eta
double zeta
Viscous hardening.
Definition plastic.cpp:131

The documentation for this struct was generated from the following file: