v0.15.0
Loading...
Searching...
No Matches
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 Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
using MatSetValuesHook
 

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)
 
- Public Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type, boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Do calculations for the left hand side.
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side.
 

Protected Attributes

boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideData
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows
 
int nbCols
 number if dof on column
 
int nbIntegrationPts
 number of integration points
 
int nbRowBaseFunctions
 number or row base functions
 
int rowSide
 row side number
 
int colSide
 column side number
 
EntityType rowType
 row type
 
EntityType colType
 column type
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix
 
MatrixDouble locMatTranspose
 local entity block matrix
 
VectorDouble locF
 local entity vector
 

Additional Inherited Members

- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set
 
FEFun feScalingFun
 assumes that time variable is set
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run.
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > getNf ()
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator.
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator.
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions.
 

Detailed Description

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

Definition at line 296 of file FormsIntegrators.hpp.

Member Typedef Documentation

◆ OP

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

Definition at line 192 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 194 of file FormsBrokenSpaceConstraintImpl.hpp.

197 : OP(NOSPACE, OP::OPSPACE), brokenBaseSideData(broken_base_side_data) {
198 OP::entsPtr = ents_ptr;
199 }
@ NOSPACE
Definition definitions.h:83
boost::shared_ptr< Range > entsPtr
Entities on which element is run.
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideData

◆ 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 201 of file FormsBrokenSpaceConstraintImpl.hpp.

206 : OP(row_field, row_field, OP::OPROW, ents_ptr),
207 brokenBaseSideData(broken_base_side_data) {
208 OP::entsPtr = ents_ptr;
209 OP::assembleTranspose = assmb_transpose;
210 OP::onlyTranspose = only_transpose;
211 OP::sYmm = false;
212 }

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 223 of file FormsBrokenSpaceConstraintImpl.hpp.

224 {
226
227 if (OP::entsPtr) {
228 if (OP::entsPtr->find(this->getFEEntityHandle()) == OP::entsPtr->end())
230 }
231
232#ifndef NDEBUG
233 if (!brokenBaseSideData) {
234 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "space not set");
235 }
236#endif // NDEBUG
237
238 auto do_work_rhs = [this](int row_side, EntityType row_type,
239 EntitiesFieldData::EntData &row_data, int sense) {
241 // get number of dofs on row
242 OP::nbRows = row_data.getIndices().size();
243 if (!OP::nbRows)
245 // get number of integration points
246 OP::nbIntegrationPts = OP::getGaussPts().size2();
247 // get row base functions
249 // resize and clear the right hand side vector
250 OP::locF.resize(OP::nbRows, false);
251 OP::locF.clear();
252 // integrate local vector
253 CHKERR this->iNtegrate(row_data);
254 // assemble local vector
255 OP::locF *= sense;
256 CHKERR this->aSsemble(row_data);
258 };
259
260 auto do_work_lhs = [this](int row_side, int col_side, EntityType row_type,
261 EntityType col_type,
262 EntitiesFieldData::EntData &row_data,
263 EntitiesFieldData::EntData &col_data, int sense) {
265
266 auto check_if_assemble_transpose = [&] {
267 if (this->sYmm) {
269 return true;
270 else
271 return false;
272 } else if (OP::assembleTranspose) {
273 return true;
274 }
275 return false;
276 };
277
278 OP::rowSide = row_side;
279 OP::rowType = row_type;
280 OP::colSide = col_side;
281 OP::colType = col_type;
282 OP::nbCols = col_data.getIndices().size();
283 OP::locMat.resize(OP::nbRows, OP::nbCols, false);
284 OP::locMat.clear();
285 CHKERR this->iNtegrate(row_data, col_data);
286 OP::locMat *= sense;
287 CHKERR this->aSsemble(row_data, col_data, check_if_assemble_transpose());
289 };
290
291 switch (OP::opType) {
292 case OP::OPROW:
293
294 OP::nbRows = row_data.getIndices().size();
295 if (!OP::nbRows)
297 OP::nbIntegrationPts = OP::getGaussPts().size2();
299
300 if (!OP::nbRows)
302
303 for (auto &bd : *brokenBaseSideData) {
304
305#ifndef NDEBUG
306 if (bd.getData().getSpace() != HDIV && bd.getData().getSpace() != HCURL) {
307 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "%s",
308 (std::string("Expect Hdiv or Hcurl space but received ") +
309 FieldSpaceNames[bd.getData().getSpace()])
310 .c_str());
311 }
312 if (!bd.getData().getNSharedPtr(bd.getData().getBase())) {
313 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
314 "base functions not set");
315 }
316#endif
317
318 CHKERR do_work_lhs(
319
320 // side
321 row_side, bd.getSide(),
322
323 // type
324 row_type, bd.getType(),
325
326 // row_data
327 row_data, bd.getData(),
328
329 // sense
330 bd.getSense()
331
332 );
333 }
334
335 break;
336 case OP::OPSPACE:
337 for (auto &bd : *brokenBaseSideData) {
338 CHKERR do_work_rhs(bd.getSide(), bd.getType(), bd.getData(),
339 bd.getSense());
340 }
341 break;
342 default:
344 (std::string("wrong op type ") +
346 .c_str());
347 }
348
350}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ HCURL
field with continuous tangents
Definition definitions.h:86
@ HDIV
field with continuous normal traction
Definition definitions.h:87
static const char *const FieldSpaceNames[]
Definition definitions.h:92
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_IMPOSSIBLE_CASE
Definition definitions.h:35
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
VectorDouble locF
local entity vector
int rowSide
row side number
int colSide
column side number
int nbRows
number of dofs on rows
EntityType colType
column type
int nbIntegrationPts
number of integration points
virtual MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data, const bool trans)
virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrate grad-grad operator.
MatrixDouble locMat
local entity block matrix
virtual size_t getNbOfBaseFunctions(EntitiesFieldData::EntData &data)
Get number of base functions.
int nbCols
number if dof on column
int nbRowBaseFunctions
number or row base functions
EntityType rowType
row type

Member Data Documentation

◆ brokenBaseSideData

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

Definition at line 218 of file FormsBrokenSpaceConstraintImpl.hpp.


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