v0.15.5
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< 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 ()
 Get local vector tensor for assembly.
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 Get local matrix tensor for assembly.
 
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)
 Assemble local matrix into global matrix.
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 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 224 of file FormsBrokenSpaceConstraintImpl.hpp.

Member Typedef Documentation

◆ OP

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

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

231 : OP(NOSPACE, OP::OPSPACE), brokenBaseSideData(broken_base_side_data) {
232 OP::entsPtr = ents_ptr;
233 OP::assembleTranspose = false;
234 OP::onlyTranspose = false;
235 OP::sYmm = false;
236 }
@ 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 238 of file FormsBrokenSpaceConstraintImpl.hpp.

243 : OP(row_field, row_field, OP::OPROW, ents_ptr),
244 brokenBaseSideData(broken_base_side_data) {
245 OP::entsPtr = ents_ptr;
246 OP::assembleTranspose = assmb_transpose;
247 OP::onlyTranspose = only_transpose;
248 OP::sYmm = false;
249 }

Member Function Documentation

◆ doWork()

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

Definition at line 260 of file FormsBrokenSpaceConstraintImpl.hpp.

261 {
263
264 if (OP::entsPtr) {
265 if (OP::entsPtr->find(this->getFEEntityHandle()) == OP::entsPtr->end())
267 }
268
269#ifndef NDEBUG
270 if (!brokenBaseSideData) {
271 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "space not set");
272 }
273#endif // NDEBUG
274
275 auto do_work_rhs = [this](int row_side, EntityType row_type,
276 EntitiesFieldData::EntData &row_data, int sense) {
278 // get number of dofs on row
279 OP::nbRows = row_data.getIndices().size();
280 if (!OP::nbRows)
282 // get number of integration points
283 OP::nbIntegrationPts = OP::getGaussPts().size2();
284 // get row base functions
286 // resize and clear the right hand side vector
287 OP::locF.resize(OP::nbRows, false);
288 OP::locF.clear();
289 // integrate local vector
290 CHKERR this->iNtegrate(row_data);
291 // assemble local vector
292 OP::locF *= sense;
293 CHKERR this->aSsemble(row_data);
295 };
296
297 auto do_work_lhs = [this](int row_side, int col_side, EntityType row_type,
298 EntityType col_type,
299 EntitiesFieldData::EntData &row_data,
300 EntitiesFieldData::EntData &col_data, int sense) {
302
303 auto check_if_assemble_transpose = [&] {
304 if (this->sYmm) {
306 return true;
307 else
308 return false;
309 } else if (OP::assembleTranspose) {
310 return true;
311 }
312 return false;
313 };
314
315 OP::rowSide = row_side;
316 OP::rowType = row_type;
317 OP::colSide = col_side;
318 OP::colType = col_type;
319 OP::nbCols = col_data.getIndices().size();
320 OP::locMat.resize(OP::nbRows, OP::nbCols, false);
321 OP::locMat.clear();
322 CHKERR this->iNtegrate(row_data, col_data);
323 OP::locMat *= sense;
324 CHKERR this->aSsemble(row_data, col_data, check_if_assemble_transpose());
326 };
327
328 switch (OP::opType) {
329 case OP::OPROW:
330
331 OP::nbRows = row_data.getIndices().size();
332 if (!OP::nbRows)
334 OP::nbIntegrationPts = OP::getGaussPts().size2();
336
337 if (!OP::nbRows)
339
340 for (auto &bd : *brokenBaseSideData) {
341
342#ifndef NDEBUG
343 if (!bd.getData().getNSharedPtr(bd.getData().getBase())) {
344 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
345 "base functions not set");
346 }
347#endif
348
349 CHKERR do_work_lhs(
350
351 // side
352 row_side, bd.getSide(),
353
354 // type
355 row_type, bd.getType(),
356
357 // row_data
358 row_data, bd.getData(),
359
360 // sense
361 bd.getSense()
362
363 );
364 }
365
366 break;
367 case OP::OPSPACE:
368 for (auto &bd : *brokenBaseSideData) {
369 CHKERR do_work_rhs(bd.getSide(), bd.getType(), bd.getData(),
370 bd.getSense());
371 }
372 break;
373 default:
375 (std::string("wrong op type ") +
377 .c_str());
378 }
379
381}
#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.
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 255 of file FormsBrokenSpaceConstraintImpl.hpp.


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