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;
22  int restartRunStep;
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  }
47 
48  // get optional command line parameters
49  virtual MoFEMErrorCode getCommandLineParameters() { return 0; };
50  virtual MoFEMErrorCode addElementFields() = 0;
51  virtual MoFEMErrorCode createElements() = 0;
52  // create and add finite elements to the DM
53  virtual MoFEMErrorCode addElementsToDM(SmartPetscObj<DM> dm) = 0;
54 
55  virtual BitRefLevel getBitRefLevel() { return BitRefLevel().set(); };
56  virtual BitRefLevel getBitRefLevelMask() { return BitRefLevel().set(); };
57 
58  // setup operators and boundary conditions
59  virtual MoFEMErrorCode setOperators() = 0;
60 
62  boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip) {
63  return 0;
64  };
66  boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip) {
67  return 0;
68  };
69 
71 
72  // virtual MoFEMErrorCode setupSolverKSP() = 0;
73  // virtual MoFEMErrorCode setupSolverTAO() = 0;
76  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "SNES not implemented");
78  };
79 
82  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "SNES not implemented");
84  };
85 
88 
89  // function executed in the monitor or at each SNES iteration
90  virtual MoFEMErrorCode updateElementVariables() { return 0; };
91  virtual MoFEMErrorCode updateElementVariables(SmartPetscObj<DM> dm,
92  string fe_name) {
93  return 0;
94  };
95 
96  // postprocessing executed in the monitor or at each SNES iteration
97  virtual MoFEMErrorCode postProcessElement(int step) = 0;
98  virtual MoFEMErrorCode postProcessElement(int step, SmartPetscObj<DM> dm,
99  string fe_name) {
100  return 0;
101  };
102 };
103 
104 #endif //__GENERICELEMENTINTERFACE_HPP__
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
GenericElementInterface::updateElementVariables
virtual MoFEMErrorCode updateElementVariables()
Definition: GenericElementInterface.hpp:90
GenericElementInterface::postProcessElement
virtual MoFEMErrorCode postProcessElement(int step, SmartPetscObj< DM > dm, string fe_name)
Definition: GenericElementInterface.hpp:98
GenericElementInterface::getCommandLineParameters
virtual MoFEMErrorCode getCommandLineParameters()
Definition: GenericElementInterface.hpp:49
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
GenericElementInterface::getBitRefLevelMask
virtual BitRefLevel getBitRefLevelMask()
Definition: GenericElementInterface.hpp:56
GenericElementInterface::IM
@ IM
Definition: GenericElementInterface.hpp:16
GenericElementInterface::getBitRefLevel
virtual BitRefLevel getBitRefLevel()
Definition: GenericElementInterface.hpp:55
GenericElementInterface::~GenericElementInterface
virtual ~GenericElementInterface()
Definition: GenericElementInterface.hpp:32
GenericElementInterface::EX
@ EX
Definition: GenericElementInterface.hpp:16
GenericElementInterface::createElements
virtual MoFEMErrorCode createElements()=0
GenericElementInterface::atomTest
int atomTest
Definition: GenericElementInterface.hpp:21
GenericElementInterface::getGlobalBoundaryMarker
virtual BcMarkerPtr getGlobalBoundaryMarker()
Definition: GenericElementInterface.hpp:40
GenericElementInterface::opFactoryDomainLhs
virtual MoFEMErrorCode opFactoryDomainLhs(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip)
Definition: GenericElementInterface.hpp:65
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::DEFAULT
@ DEFAULT
Definition: GenericElementInterface.hpp:16
GenericElementInterface::setupSolverJacobianSNES
virtual MoFEMErrorCode setupSolverJacobianSNES()
Definition: GenericElementInterface.hpp:74
GenericElementInterface::setupSolverFunctionTS
virtual MoFEMErrorCode setupSolverFunctionTS(const TSType type)=0
GenericElementInterface::opFactoryDomainRhs
virtual MoFEMErrorCode opFactoryDomainRhs(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip)
Definition: GenericElementInterface.hpp:61
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::IMEX
@ IMEX
Definition: GenericElementInterface.hpp:16
GenericElementInterface::setMonitorPtr
virtual MoFEMErrorCode setMonitorPtr(boost::shared_ptr< FEMethod > monitor_ptr)
Definition: GenericElementInterface.hpp:42
GenericElementInterface::IM2
@ IM2
Definition: GenericElementInterface.hpp:16
GenericElementInterface::mBoundaryMarker
BcMarkerPtr mBoundaryMarker
Definition: GenericElementInterface.hpp:20
GenericElementInterface::setUpdateElementVariablesOperators
virtual MoFEMErrorCode setUpdateElementVariablesOperators()
Definition: GenericElementInterface.hpp:70
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:80
GenericElementInterface::updateElementVariables
virtual MoFEMErrorCode updateElementVariables(SmartPetscObj< DM > dm, string fe_name)
Definition: GenericElementInterface.hpp:91
GenericElementInterface::monitorPtr
boost::shared_ptr< MoFEM::FEMethod > monitorPtr
Definition: GenericElementInterface.hpp:24
GenericElementInterface::postProcessElement
virtual MoFEMErrorCode postProcessElement(int step)=0
GenericElementInterface::addElementsToDM
virtual MoFEMErrorCode addElementsToDM(SmartPetscObj< DM > dm)=0
GenericElementInterface::TSType
TSType
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:453
GenericElementInterface::BcMarkerPtr
boost::shared_ptr< std::vector< char unsigned > > BcMarkerPtr
Definition: GenericElementInterface.hpp:17
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32