v0.15.0
Loading...
Searching...
No Matches
MoFEM::FieldEvaluatorInterface::SetPts Struct Reference

Default evaluator for setting integration points. More...

#include "src/interfaces/FieldEvaluator.hpp"

Collaboration diagram for MoFEM::FieldEvaluatorInterface::SetPts:
[legend]

Public Member Functions

 SetPts ()=delete
 
 SetPts (boost::shared_ptr< SetPtsData > data_ptr)
 
MoFEMErrorCode operator() (ForcesAndSourcesCore *fe_raw_ptr, int order_row, int order_col, int order_data)
 

Private Attributes

boost::weak_ptr< SetPtsDatadataPtr
 

Detailed Description

Default evaluator for setting integration points.

Definition at line 76 of file FieldEvaluator.hpp.

Constructor & Destructor Documentation

◆ SetPts() [1/2]

MoFEM::FieldEvaluatorInterface::SetPts::SetPts ( )
delete

◆ SetPts() [2/2]

MoFEM::FieldEvaluatorInterface::SetPts::SetPts ( boost::shared_ptr< SetPtsData > data_ptr)
inline

Definition at line 78 of file FieldEvaluator.hpp.

78: dataPtr(data_ptr) {}
boost::weak_ptr< SetPtsData > dataPtr

Member Function Documentation

◆ operator()()

MoFEMErrorCode MoFEM::FieldEvaluatorInterface::SetPts::operator() ( ForcesAndSourcesCore * fe_raw_ptr,
int order_row,
int order_col,
int order_data )

Definition at line 83 of file FieldEvaluator.cpp.

85 {
87
88 if (auto data_ptr = dataPtr.lock()) {
89
90 const auto nb_eval_points = data_ptr->nbEvalPoints;
91 const auto &shape_functions = data_ptr->shapeFunctions;
92 const auto &eval_pointentity_handle = data_ptr->evalPointEntityHandle;
93
94 if (auto fe_ptr = data_ptr->feMethodPtr.lock()) {
95
96 auto &fe = static_cast<ForcesAndSourcesCore &>(*fe_ptr);
97
98#ifndef NDEBUG
99 if (fe_ptr.get() != fe_raw_ptr)
100 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Wrong FE ptr");
101#endif
102
103 const auto fe_ent = fe.numeredEntFiniteElementPtr->getEnt();
104 const auto fe_type = type_from_handle(fe_ent);
105 const auto fe_dim = moab::CN::Dimension(fe_type);
106
107 auto &gauss_pts = fe.gaussPts;
108 int nb_gauss_pts;
109
110 if (fe_dim == 3) {
111 gauss_pts.resize(4, nb_eval_points, false);
113 &shape_functions(0, 0), &shape_functions(0, 1),
114 &shape_functions(0, 2), &shape_functions(0, 3)};
116 &gauss_pts(0, 0), &gauss_pts(1, 0), &gauss_pts(2, 0)};
117
118 nb_gauss_pts = 0;
119 for (int nn = 0; nn != nb_eval_points; ++nn) {
120 if (eval_pointentity_handle[nn] == fe_ent) {
121 for (const int i : {0, 1, 2}) {
122 t_gauss_pts(i) = t_shape(i + 1);
123 }
124 gauss_pts(3, nb_gauss_pts) = nn;
125 ++t_gauss_pts;
126 ++nb_gauss_pts;
127 }
128 ++t_shape;
129 }
130 gauss_pts.resize(4, nb_gauss_pts, true);
131 } else if (fe_dim == 2) {
132 gauss_pts.resize(3, nb_eval_points, false);
134 &shape_functions(0, 0), &shape_functions(0, 1),
135 &shape_functions(0, 2)};
137 &gauss_pts(0, 0), &gauss_pts(1, 0)};
138 nb_gauss_pts = 0;
139 for (int nn = 0; nn != nb_eval_points; ++nn) {
140 if (eval_pointentity_handle[nn] == fe_ent) {
141 for (const int i : {0, 1}) {
142 t_gauss_pts(i) = t_shape(i + 1);
143 }
144 gauss_pts(2, nb_gauss_pts) = nn;
145 ++t_gauss_pts;
146 ++nb_gauss_pts;
147 }
148 ++t_shape;
149 }
150 gauss_pts.resize(3, nb_gauss_pts, true);
151 } else {
152 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
153 "Dimension not implemented");
154 }
155
156#ifndef NDEBUG
157 MOFEM_LOG("SELF", Sev::noisy)
158 << "nbEvalOPoints / nbGau_sspt_s: " << nb_eval_points << " / "
159 << nb_gauss_pts;
160 MOFEM_LOG("SELF", Sev::noisy) << "gauss pts: " << gauss_pts;
161#endif
162
163 } else
164 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
165 "Pointer to element does not exists");
166
167 } else
168 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
169 "Pointer to data does not exists");
170
172}
#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
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
auto type_from_handle(const EntityHandle h)
get type from entity handle

Member Data Documentation

◆ dataPtr

boost::weak_ptr<SetPtsData> MoFEM::FieldEvaluatorInterface::SetPts::dataPtr
private

Definition at line 83 of file FieldEvaluator.hpp.


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