v0.14.0
Public Types | Public Member Functions | Protected Attributes | List of all members
MoFEM::OpBrokenBaseImpl< OpBase > Struct Template Reference

#include <src/finite_elements/FormsBrokenSpaceConstraintImpl.hpp>

Inheritance diagram for MoFEM::OpBrokenBaseImpl< OpBase >:
[legend]
Collaboration diagram for MoFEM::OpBrokenBaseImpl< OpBase >:
[legend]

Public Types

using OP = OpBase
 

Public Member Functions

 OpBrokenBaseImpl (boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_base_side_data, boost::shared_ptr< Range > ents_ptr=nullptr)
 
 OpBrokenBaseImpl (const std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_base_side_data, const bool assmb_transpose, const bool only_transpose, boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
 

Protected Attributes

boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideData
 

Detailed Description

template<typename OpBase>
struct MoFEM::OpBrokenBaseImpl< OpBase >

Definition at line 171 of file FormsBrokenSpaceConstraintImpl.hpp.

Member Typedef Documentation

◆ OP

template<typename OpBase >
using MoFEM::OpBrokenBaseImpl< OpBase >::OP = OpBase

Definition at line 173 of file FormsBrokenSpaceConstraintImpl.hpp.

Constructor & Destructor Documentation

◆ OpBrokenBaseImpl() [1/2]

template<typename OpBase >
MoFEM::OpBrokenBaseImpl< OpBase >::OpBrokenBaseImpl ( boost::shared_ptr< std::vector< BrokenBaseSideData >>  broken_base_side_data,
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Definition at line 175 of file FormsBrokenSpaceConstraintImpl.hpp.

178  : OP(NOSPACE, OP::OPSPACE), brokenBaseSideData(broken_base_side_data) {
179  OP::entsPtr = ents_ptr;
180  }

◆ OpBrokenBaseImpl() [2/2]

template<typename OpBase >
MoFEM::OpBrokenBaseImpl< OpBase >::OpBrokenBaseImpl ( const std::string  row_field,
boost::shared_ptr< std::vector< BrokenBaseSideData >>  broken_base_side_data,
const bool  assmb_transpose,
const bool  only_transpose,
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Definition at line 182 of file FormsBrokenSpaceConstraintImpl.hpp.

187  : OP(row_field, row_field, OP::OPROW, ents_ptr),
188  brokenBaseSideData(broken_base_side_data) {
189  OP::entsPtr = ents_ptr;
190  OP::assembleTranspose = assmb_transpose;
191  OP::onlyTranspose = only_transpose;
192  OP::sYmm = false;
193  }

Member Function Documentation

◆ doWork()

template<typename OpBase >
MoFEMErrorCode MoFEM::OpBrokenBaseImpl< OpBase >::doWork ( int  row_side,
EntityType  row_type,
EntitiesFieldData::EntData row_data 
)

Definition at line 204 of file FormsBrokenSpaceConstraintImpl.hpp.

205  {
207 
208  if (OP::entsPtr) {
209  if (OP::entsPtr->find(this->getFEEntityHandle()) == OP::entsPtr->end())
211  }
212 
213 #ifndef NDEBUG
214  if (!brokenBaseSideData) {
215  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "space not set");
216  }
217 #endif // NDEBUG
218 
219  auto do_work_rhs = [this](int row_side, EntityType row_type,
220  EntitiesFieldData::EntData &row_data, int sense) {
222  // get number of dofs on row
223  OP::nbRows = row_data.getIndices().size();
224  if (!OP::nbRows)
226  // get number of integration points
227  OP::nbIntegrationPts = OP::getGaussPts().size2();
228  // get row base functions
230  // resize and clear the right hand side vector
231  OP::locF.resize(OP::nbRows, false);
232  OP::locF.clear();
233  // integrate local vector
234  CHKERR this->iNtegrate(row_data);
235  // assemble local vector
236  OP::locF *= sense;
237  CHKERR this->aSsemble(row_data);
239  };
240 
241  auto do_work_lhs = [this](int row_side, int col_side, EntityType row_type,
242  EntityType col_type,
243  EntitiesFieldData::EntData &row_data,
244  EntitiesFieldData::EntData &col_data, int sense) {
246 
247  auto check_if_assemble_transpose = [&] {
248  if (this->sYmm) {
250  return true;
251  else
252  return false;
253  } else if (OP::assembleTranspose) {
254  return true;
255  }
256  return false;
257  };
258 
259  OP::rowSide = row_side;
260  OP::rowType = row_type;
261  OP::colSide = col_side;
262  OP::colType = col_type;
263  OP::nbCols = col_data.getIndices().size();
264  OP::locMat.resize(OP::nbRows, OP::nbCols, false);
265  OP::locMat.clear();
266  CHKERR this->iNtegrate(row_data, col_data);
267  OP::locMat *= sense;
268  CHKERR this->aSsemble(row_data, col_data, check_if_assemble_transpose());
270  };
271 
272  switch (OP::opType) {
273  case OP::OPROW:
274 
275  OP::nbRows = row_data.getIndices().size();
276  if (!OP::nbRows)
278  OP::nbIntegrationPts = OP::getGaussPts().size2();
280 
281  if (!OP::nbRows)
283 
284  for (auto &bd : *brokenBaseSideData) {
285 
286 #ifndef NDEBUG
287  if (bd.getData().getSpace() != HDIV && bd.getData().getSpace() != HCURL) {
288  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
289  (std::string("Expect Hdiv or Hcurl space but received ") +
290  FieldSpaceNames[bd.getData().getSpace()])
291  .c_str());
292  }
293  if (!bd.getData().getNSharedPtr(bd.getData().getBase())) {
294  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
295  "base functions not set");
296  }
297 #endif
298 
299  CHKERR do_work_lhs(
300 
301  // side
302  row_side, bd.getSide(),
303 
304  // type
305  row_type, bd.getType(),
306 
307  // row_data
308  row_data, bd.getData(),
309 
310  // sense
311  bd.getSense()
312 
313  );
314  }
315 
316  break;
317  case OP::OPSPACE:
318  for (auto &bd : *brokenBaseSideData) {
319  CHKERR do_work_rhs(bd.getSide(), bd.getType(), bd.getData(),
320  bd.getSense());
321  }
322  break;
323  default:
325  (std::string("wrong op type ") +
327  .c_str());
328  }
329 
331 }

Member Data Documentation

◆ brokenBaseSideData

template<typename OpBase >
boost::shared_ptr<std::vector<BrokenBaseSideData> > MoFEM::OpBrokenBaseImpl< OpBase >::brokenBaseSideData
protected

Definition at line 199 of file FormsBrokenSpaceConstraintImpl.hpp.


The documentation for this struct was generated from the following file:
NOSPACE
@ NOSPACE
Definition: definitions.h:83
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:589
MoFEM::OpBaseImpl::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: FormsIntegrators.hpp:238
MoFEM::OpBaseImpl::locMat
MatrixDouble locMat
local entity block matrix
Definition: FormsIntegrators.hpp:249
MoFEM::ForcesAndSourcesCore::UserDataOperator::OpTypeNames
static const char *const OpTypeNames[]
Definition: ForcesAndSourcesCore.hpp:574
MoFEM::OpBrokenBaseImpl::brokenBaseSideData
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideData
Definition: FormsBrokenSpaceConstraintImpl.hpp:199
MoFEM::OpBaseImpl::assembleTranspose
bool assembleTranspose
Definition: FormsIntegrators.hpp:246
MOFEM_IMPOSSIBLE_CASE
@ MOFEM_IMPOSSIBLE_CASE
Definition: definitions.h:35
MoFEM::OpBaseImpl::locF
VectorDouble locF
local entity vector
Definition: FormsIntegrators.hpp:251
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::OpBaseImpl::colSide
int colSide
column side number
Definition: FormsIntegrators.hpp:242
MoFEM::OpBrokenBaseImpl::OP
OpBase OP
Definition: FormsBrokenSpaceConstraintImpl.hpp:173
MoFEM::OpBaseImpl::onlyTranspose
bool onlyTranspose
Definition: FormsIntegrators.hpp:247
EntData
EntitiesFieldData::EntData EntData
Definition: child_and_parent.cpp:37
MoFEM::OpBaseImpl::nbRowBaseFunctions
int nbRowBaseFunctions
number or row base functions
Definition: FormsIntegrators.hpp:239
MoFEM::OpBaseImpl::rowSide
int rowSide
row side number
Definition: FormsIntegrators.hpp:241
MoFEM::OpBaseImpl::nbCols
int nbCols
number if dof on column
Definition: FormsIntegrators.hpp:237
FieldSpaceNames
const static char *const FieldSpaceNames[]
Definition: definitions.h:92
MoFEM::OpBaseImpl::nbRows
int nbRows
number of dofs on rows
Definition: FormsIntegrators.hpp:236
MoFEM::OpBaseImpl::entsPtr
boost::shared_ptr< Range > entsPtr
Entities on which element is run.
Definition: FormsIntegrators.hpp:213
HCURL
@ HCURL
field with continuous tangents
Definition: definitions.h:86
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::OpBaseImpl::getNbOfBaseFunctions
virtual size_t getNbOfBaseFunctions(EntitiesFieldData::EntData &data)
Get number of base functions.
Definition: FormsIntegrators.hpp:351
MoFEM::OpBaseImpl::rowType
EntityType rowType
row type
Definition: FormsIntegrators.hpp:243
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
HDIV
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::OpBaseImpl::colType
EntityType colType
column type
Definition: FormsIntegrators.hpp:244