v0.16.3
Loading...
Searching...
No Matches
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 Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
using MatSetValuesHook = boost::function< MoFEMErrorCode(ForcesAndSourcesCore::UserDataOperator *op_ptr, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, MatrixDouble &m)>
 

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)
 Constructor for base operator implementation.
 
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
 set by fe entity handle
 
boost::shared_ptr< Range > entsPtr
 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>
auto getNf ()
 Get local vector tensor for assembly.
 
template<int ROW_DIM, int COL_DIM = ROW_DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, COL_DIM >, ROW_DIM, COL_DIM > getLocMat (const int rr)
 Get local matrix tensor for assembly.
 
virtual MoFEMErrorCode iNtegrate (EntData &, EntData &)
 Integrate grad-grad operator.
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 Assemble local matrix into global matrix.
 
virtual MoFEMErrorCode iNtegrate (EntData &)
 Class dedicated to integrate operator.
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 Assemble local vector into global vector.
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions.
 

Detailed Description

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

Definition at line 239 of file FormsBrokenSpaceConstraintImpl.hpp.

Member Typedef Documentation

◆ OP

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

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

246 : OP(NOSPACE, OP::OPSPACE), brokenBaseSideData(broken_base_side_data) {
247 OP::entsPtr = ents_ptr;
248 OP::assembleTranspose = false;
249 OP::onlyTranspose = false;
250 OP::sYmm = false;
251 }
@ 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 253 of file FormsBrokenSpaceConstraintImpl.hpp.

258 : OP(row_field, row_field, OP::OPROW, ents_ptr),
259 brokenBaseSideData(broken_base_side_data) {
260 OP::entsPtr = ents_ptr;
261 OP::assembleTranspose = assmb_transpose;
262 OP::onlyTranspose = only_transpose;
263 OP::sYmm = false;
264 }

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

276 {
278
279 if (OP::entsPtr) {
280 if (OP::entsPtr->find(this->getFEEntityHandle()) == OP::entsPtr->end())
282 }
283
284#ifndef NDEBUG
285 if (!brokenBaseSideData) {
286 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "space not set");
287 }
288#endif // NDEBUG
289
290 auto do_work_rhs = [this](int, EntityType,
291 EntitiesFieldData::EntData &row_data, int sense) {
293 // get number of dofs on row
294 OP::nbRows = row_data.getIndices().size();
295 if (!OP::nbRows)
297 // get number of integration points
298 OP::nbIntegrationPts = OP::getGaussPts().size2();
299 // get row base functions
301 // resize and clear the right hand side vector
302 OP::locF.resize(OP::nbRows, false);
303 OP::locF.clear();
304 // integrate local vector
305 CHKERR this->iNtegrate(row_data);
306 // assemble local vector
307 OP::locF *= sense;
308 CHKERR this->aSsemble(row_data);
310 };
311
312 auto do_work_lhs = [this](int row_side, int col_side, EntityType row_type,
313 EntityType col_type,
314 EntitiesFieldData::EntData &row_data,
315 EntitiesFieldData::EntData &col_data, int sense) {
317
318 auto check_if_assemble_transpose = [&] {
319 if (this->sYmm) {
321 return true;
322 else
323 return false;
324 } else if (OP::assembleTranspose) {
325 return true;
326 }
327 return false;
328 };
329
330 OP::rowSide = row_side;
331 OP::rowType = row_type;
332 OP::colSide = col_side;
333 OP::colType = col_type;
334 OP::nbCols = col_data.getIndices().size();
335 OP::locMat.resize(OP::nbRows, OP::nbCols, false);
336 OP::locMat.clear();
337 CHKERR this->iNtegrate(row_data, col_data);
338 OP::locMat *= sense;
339 CHKERR this->aSsemble(row_data, col_data, check_if_assemble_transpose());
341 };
342
343 switch (OP::opType) {
344 case OP::OPROW:
345
346 OP::nbRows = row_data.getIndices().size();
347 if (!OP::nbRows)
349 OP::nbIntegrationPts = OP::getGaussPts().size2();
351
352 if (!OP::nbRows)
354
355 for (auto &bd : *brokenBaseSideData) {
356
357#ifndef NDEBUG
358 if (!bd.getData().getNSharedPtr(bd.getData().getBase())) {
359 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
360 "base functions not set");
361 }
362#endif
363
364 CHKERR do_work_lhs(
365
366 // side
367 row_side, bd.getSide(),
368
369 // type
370 row_type, bd.getType(),
371
372 // row_data
373 row_data, bd.getData(),
374
375 // sense
376 bd.getSense()
377
378 );
379 }
380
381 break;
382 case OP::OPSPACE:
383 for (auto &bd : *brokenBaseSideData) {
384 CHKERR do_work_rhs(bd.getSide(), bd.getType(), bd.getData(),
385 bd.getSense());
386 }
387 break;
388 default:
391 (std::string("wrong op type ") +
392 OpBaseDerivativesBase::OpTypeNames[static_cast<unsigned char>(
393 OP::opType)])
394 .c_str());
395 }
396
398}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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)
Assemble local matrix into global matrix.
MatrixDouble locMat
local entity block matrix
virtual size_t getNbOfBaseFunctions(EntitiesFieldData::EntData &data)
Get number of base functions.
virtual MoFEMErrorCode iNtegrate(EntData &, EntData &)
Integrate grad-grad operator.
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 270 of file FormsBrokenSpaceConstraintImpl.hpp.


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