v0.15.5
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
MoFEM::FieldEvaluatorInterface::SetIntegrationPtsMethod Struct Reference

#include "src/interfaces/FieldEvaluator.hpp"

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

Public Member Functions

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

Private Attributes

boost::weak_ptr< SetIntegrationPtsMethodDatadataPtr
 

Detailed Description

Definition at line 311 of file FieldEvaluator.hpp.

Constructor & Destructor Documentation

◆ SetIntegrationPtsMethod() [1/2]

MoFEM::FieldEvaluatorInterface::SetIntegrationPtsMethod::SetIntegrationPtsMethod ( )
delete

◆ SetIntegrationPtsMethod() [2/2]

MoFEM::FieldEvaluatorInterface::SetIntegrationPtsMethod::SetIntegrationPtsMethod ( boost::shared_ptr< SetIntegrationPtsMethodData data_ptr)

Definition at line 78 of file FieldEvaluator.cpp.

80 : dataPtr(data_ptr) {}
boost::weak_ptr< SetIntegrationPtsMethodData > dataPtr

Member Function Documentation

◆ operator()()

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

Definition at line 82 of file FieldEvaluator.cpp.

84 {
86
87 if (auto data_ptr = dataPtr.lock()) {
88
89 const auto nb_eval_points = data_ptr->nbEvalPoints;
90 const auto &shape_functions = data_ptr->shapeFunctions;
91 const auto &eval_pointentity_handle = data_ptr->evalPointEntityHandle;
92
93 if (auto fe_ptr = data_ptr->feMethodPtr) {
94
95 auto &fe = static_cast<ForcesAndSourcesCore &>(*fe_ptr);
96
97#ifndef NDEBUG
98 if (fe_ptr.get() != fe_raw_ptr)
99 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Wrong FE ptr");
100#endif
101
102 const auto fe_ent = fe.numeredEntFiniteElementPtr->getEnt();
103 const auto fe_type = type_from_handle(fe_ent);
104 const auto fe_dim = moab::CN::Dimension(fe_type);
105
106 auto &gauss_pts = fe.gaussPts;
107 int nb_gauss_pts;
108
109 if (fe_dim == 3) {
110 gauss_pts.resize(4, nb_eval_points, false);
112 &shape_functions(0, 0), &shape_functions(0, 1),
113 &shape_functions(0, 2), &shape_functions(0, 3)};
115 &gauss_pts(0, 0), &gauss_pts(1, 0), &gauss_pts(2, 0)};
116
117 nb_gauss_pts = 0;
118 for (int nn = 0; nn != nb_eval_points; ++nn) {
119 if (eval_pointentity_handle[nn] == fe_ent) {
120 for (const int i : {0, 1, 2}) {
121 t_gauss_pts(i) = t_shape(i + 1);
122 }
123 gauss_pts(3, nb_gauss_pts) = nn;
124 ++t_gauss_pts;
125 ++nb_gauss_pts;
126 }
127 ++t_shape;
128 }
129 gauss_pts.resize(4, nb_gauss_pts, true);
130 } else if (fe_dim == 2) {
131 gauss_pts.resize(3, nb_eval_points, false);
133 &shape_functions(0, 0), &shape_functions(0, 1),
134 &shape_functions(0, 2)};
136 &gauss_pts(0, 0), &gauss_pts(1, 0)};
137 nb_gauss_pts = 0;
138 for (int nn = 0; nn != nb_eval_points; ++nn) {
139 if (eval_pointentity_handle[nn] == fe_ent) {
140 for (const int i : {0, 1}) {
141 t_gauss_pts(i) = t_shape(i + 1);
142 }
143 gauss_pts(2, nb_gauss_pts) = nn;
144 ++t_gauss_pts;
145 ++nb_gauss_pts;
146 }
147 ++t_shape;
148 }
149 gauss_pts.resize(3, nb_gauss_pts, true);
150 } else {
151 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
152 "Dimension not implemented");
153 }
154
155#ifndef NDEBUG
156 MOFEM_LOG("SELF", Sev::noisy)
157 << "nbEvalOPoints / nbGau_sspt_s: " << nb_eval_points << " / "
158 << nb_gauss_pts;
159 MOFEM_LOG("SELF", Sev::noisy) << "gauss pts: " << gauss_pts;
160#endif
161
162 } else
163 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
164 "Pointer to element does not exists");
165
166 } else
167 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
168 "Pointer to data does not exists");
169
171}
#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<SetIntegrationPtsMethodData> MoFEM::FieldEvaluatorInterface::SetIntegrationPtsMethod::dataPtr
private

Definition at line 319 of file FieldEvaluator.hpp.


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