v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
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 69 of file FieldEvaluator.cpp.

71 {
73
74 if (auto data_ptr = dataPtr.lock()) {
75
76 const auto nb_eval_points = data_ptr->nbEvalPoints;
77 const auto &shape_functions = data_ptr->shapeFunctions;
78 const auto &eval_pointentity_handle = data_ptr->evalPointEntityHandle;
79
80 if (auto fe_ptr = data_ptr->feMethodPtr.lock()) {
81
82 auto &fe = static_cast<ForcesAndSourcesCore &>(*fe_ptr);
83
84#ifndef NDEBUG
85 if (fe_ptr.get() != fe_raw_ptr)
86 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Wrong FE ptr");
87#endif
88
89 const auto fe_ent = fe.numeredEntFiniteElementPtr->getEnt();
90 const auto fe_type = type_from_handle(fe_ent);
91 const auto fe_dim = moab::CN::Dimension(fe_type);
92
93 auto &gauss_pts = fe.gaussPts;
94 int nb_gauss_pts;
95
96 if (fe_dim == 3) {
97 gauss_pts.resize(4, nb_eval_points, false);
99 &shape_functions(0, 0), &shape_functions(0, 1),
100 &shape_functions(0, 2), &shape_functions(0, 3)};
102 &gauss_pts(0, 0), &gauss_pts(1, 0), &gauss_pts(2, 0)};
103
104 nb_gauss_pts = 0;
105 for (int nn = 0; nn != nb_eval_points; ++nn) {
106 if (eval_pointentity_handle[nn] == fe_ent) {
107 for (const int i : {0, 1, 2}) {
108 t_gauss_pts(i) = t_shape(i + 1);
109 }
110 gauss_pts(3, nb_gauss_pts) = nn;
111 ++t_gauss_pts;
112 ++nb_gauss_pts;
113 }
114 ++t_shape;
115 }
116 gauss_pts.resize(4, nb_gauss_pts, true);
117 } else if (fe_dim == 2) {
118 gauss_pts.resize(3, nb_eval_points, false);
120 &shape_functions(0, 0), &shape_functions(0, 1),
121 &shape_functions(0, 2)};
123 &gauss_pts(0, 0), &gauss_pts(1, 0)};
124 nb_gauss_pts = 0;
125 for (int nn = 0; nn != nb_eval_points; ++nn) {
126 if (eval_pointentity_handle[nn] == fe_ent) {
127 for (const int i : {0, 1}) {
128 t_gauss_pts(i) = t_shape(i + 1);
129 }
130 gauss_pts(2, nb_gauss_pts) = nn;
131 ++t_gauss_pts;
132 ++nb_gauss_pts;
133 }
134 ++t_shape;
135 }
136 gauss_pts.resize(3, nb_gauss_pts, true);
137 } else {
138 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
139 "Dimension not implemented");
140 }
141
142#ifndef NDEBUG
143 MOFEM_LOG("SELF", Sev::noisy)
144 << "nbEvalOPoints / nbGau_sspt_s: " << nb_eval_points << " / "
145 << nb_gauss_pts;
146 MOFEM_LOG("SELF", Sev::noisy) << "gauss pts: " << gauss_pts;
147#endif
148
149 } else
150 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
151 "Pointer to element does not exists");
152
153 } else
154 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
155 "Pointer to data does not exists");
156
158}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ 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()
Definition: definitions.h:416
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
FTensor::Index< 'i', SPACE_DIM > i
auto type_from_handle(const EntityHandle h)
get type from entity handle
Definition: Templates.hpp:1918

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: