v0.14.0
GenericElementInterface.hpp
Go to the documentation of this file.
1 /** \file GenericElementInterface.hpp
2  \brief Header file for GenericElementInterface element implementation
3 */
4 
5 
6 
7 #ifndef __GENERICELEMENTINTERFACE_HPP__
8 #define __GENERICELEMENTINTERFACE_HPP__
9 
10 /** \brief Set of functions declaring elements and setting operators
11  * for generic element interface
12  */
14 
15  // typedef const char *TSType;
16  enum TSType { EX, IM, IM2, IMEX, DEFAULT };
17  using BcMarkerPtr = boost::shared_ptr<std::vector<char unsigned>>;
18 
19 
21  int atomTest;
23 
24  boost::shared_ptr<FEMethod> monitorPtr;
25 
26  // TODO: members to add
27  // add global/common boundary marker
28  // add global/common post processing
29  // add global/common post processing on skin
30 
33 
36  mBoundaryMarker = mark;
38  }
39 
41 
42  virtual MoFEMErrorCode setMonitorPtr(boost::shared_ptr<FEMethod> monitor_ptr) {
44  monitorPtr = monitor_ptr;
46  return 0;
47  }
48 
49  // get optional command line parameters
50  virtual MoFEMErrorCode getCommandLineParameters() { return 0; };
51  virtual MoFEMErrorCode addElementFields() = 0;
52  virtual MoFEMErrorCode createElements() = 0;
53  // create and add finite elements to the DM
54  virtual MoFEMErrorCode addElementsToDM(SmartPetscObj<DM> dm) = 0;
55 
56  virtual BitRefLevel getBitRefLevel() { return BitRefLevel().set(); };
57  virtual BitRefLevel getBitRefLevelMask() { return BitRefLevel().set(); };
58  virtual MoFEMErrorCode setOperators() = 0;
59  // setup operators and boundary conditions
60 
61  // virtual MoFEMErrorCode setupSolverKSP() = 0;
62  // virtual MoFEMErrorCode setupSolverTAO() = 0;
65  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "SNES not implemented");
67  };
68 
71  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "SNES not implemented");
73  };
74 
77 
78  // function executed in the monitor or at each SNES iteration
79  virtual MoFEMErrorCode updateElementVariables() { return 0; };
80  // postprocessing executed in the monitor or at each SNES iteration
81  virtual MoFEMErrorCode postProcessElement(int step) = 0;
82 };
83 
84 #endif //__GENERICELEMENTINTERFACE_HPP__
GenericElementInterface::EX
@ EX
Definition: GenericElementInterface.hpp:16
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
GenericElementInterface::updateElementVariables
virtual MoFEMErrorCode updateElementVariables()
Definition: GenericElementInterface.hpp:79
GenericElementInterface::getCommandLineParameters
virtual MoFEMErrorCode getCommandLineParameters()
Definition: GenericElementInterface.hpp:50
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
GenericElementInterface::getBitRefLevelMask
virtual BitRefLevel getBitRefLevelMask()
Definition: GenericElementInterface.hpp:57
GenericElementInterface::getBitRefLevel
virtual BitRefLevel getBitRefLevel()
Definition: GenericElementInterface.hpp:56
GenericElementInterface::~GenericElementInterface
virtual ~GenericElementInterface()
Definition: GenericElementInterface.hpp:32
GenericElementInterface::createElements
virtual MoFEMErrorCode createElements()=0
GenericElementInterface::atomTest
int atomTest
Definition: GenericElementInterface.hpp:21
GenericElementInterface::IMEX
@ IMEX
Definition: GenericElementInterface.hpp:16
GenericElementInterface::getGlobalBoundaryMarker
virtual BcMarkerPtr getGlobalBoundaryMarker()
Definition: GenericElementInterface.hpp:40
GenericElementInterface::restartRunStep
int restartRunStep
Definition: GenericElementInterface.hpp:22
GenericElementInterface
Set of functions declaring elements and setting operators for generic element interface.
Definition: GenericElementInterface.hpp:13
GenericElementInterface::setOperators
virtual MoFEMErrorCode setOperators()=0
GenericElementInterface::setupSolverJacobianSNES
virtual MoFEMErrorCode setupSolverJacobianSNES()
Definition: GenericElementInterface.hpp:63
GenericElementInterface::setupSolverFunctionTS
virtual MoFEMErrorCode setupSolverFunctionTS(const TSType type)=0
GenericElementInterface::GenericElementInterface
GenericElementInterface()
Definition: GenericElementInterface.hpp:31
GenericElementInterface::addElementFields
virtual MoFEMErrorCode addElementFields()=0
convert.type
type
Definition: convert.py:64
GenericElementInterface::monitorPtr
boost::shared_ptr< FEMethod > monitorPtr
Definition: GenericElementInterface.hpp:24
GenericElementInterface::setMonitorPtr
virtual MoFEMErrorCode setMonitorPtr(boost::shared_ptr< FEMethod > monitor_ptr)
Definition: GenericElementInterface.hpp:42
GenericElementInterface::mBoundaryMarker
BcMarkerPtr mBoundaryMarker
Definition: GenericElementInterface.hpp:20
GenericElementInterface::setGlobalBoundaryMarker
virtual MoFEMErrorCode setGlobalBoundaryMarker(BcMarkerPtr mark)
Definition: GenericElementInterface.hpp:34
GenericElementInterface::setupSolverJacobianTS
virtual MoFEMErrorCode setupSolverJacobianTS(const TSType type)=0
GenericElementInterface::setupSolverFunctionSNES
virtual MoFEMErrorCode setupSolverFunctionSNES()
Definition: GenericElementInterface.hpp:69
GenericElementInterface::postProcessElement
virtual MoFEMErrorCode postProcessElement(int step)=0
GenericElementInterface::addElementsToDM
virtual MoFEMErrorCode addElementsToDM(SmartPetscObj< DM > dm)=0
GenericElementInterface::TSType
TSType
Definition: GenericElementInterface.hpp:16
GenericElementInterface::DEFAULT
@ DEFAULT
Definition: GenericElementInterface.hpp:16
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
GenericElementInterface::BcMarkerPtr
boost::shared_ptr< std::vector< char unsigned > > BcMarkerPtr
Definition: GenericElementInterface.hpp:17
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
GenericElementInterface::IM2
@ IM2
Definition: GenericElementInterface.hpp:16
GenericElementInterface::IM
@ IM
Definition: GenericElementInterface.hpp:16