v0.14.0
Loading...
Searching...
No Matches
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
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
34 virtual MoFEMErrorCode setGlobalBoundaryMarker(BcMarkerPtr mark) {
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;
63 virtual MoFEMErrorCode setupSolverJacobianSNES() {
65 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "SNES not implemented");
67 };
68
69 virtual MoFEMErrorCode setupSolverFunctionSNES() {
71 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "SNES not implemented");
73 };
74
75 virtual MoFEMErrorCode setupSolverJacobianTS(const TSType type) = 0;
76 virtual MoFEMErrorCode setupSolverFunctionTS(const TSType type) = 0;
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__
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Set of functions declaring elements and setting operators for generic element interface.
virtual MoFEMErrorCode addElementFields()=0
virtual MoFEMErrorCode setupSolverFunctionSNES()
boost::shared_ptr< FEMethod > monitorPtr
virtual MoFEMErrorCode setupSolverFunctionTS(const TSType type)=0
virtual MoFEMErrorCode setGlobalBoundaryMarker(BcMarkerPtr mark)
virtual MoFEMErrorCode createElements()=0
virtual MoFEMErrorCode setupSolverJacobianTS(const TSType type)=0
virtual MoFEMErrorCode getCommandLineParameters()
virtual MoFEMErrorCode setMonitorPtr(boost::shared_ptr< FEMethod > monitor_ptr)
virtual BitRefLevel getBitRefLevel()
virtual MoFEMErrorCode updateElementVariables()
boost::shared_ptr< std::vector< char unsigned > > BcMarkerPtr
virtual MoFEMErrorCode postProcessElement(int step)=0
virtual MoFEMErrorCode setupSolverJacobianSNES()
virtual MoFEMErrorCode setOperators()=0
virtual MoFEMErrorCode addElementsToDM(SmartPetscObj< DM > dm)=0
virtual BcMarkerPtr getGlobalBoundaryMarker()
virtual BitRefLevel getBitRefLevelMask()