v0.14.0
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
hello_world.cpp File Reference
#include <BasicFiniteElements.hpp>

Go to the source code of this file.

Classes

struct  OpRow
 
struct  OpRowCol
 
struct  OpVolume
 
struct  OpFace
 
struct  OpFaceSide
 
struct  OpVolumeSide
 

Macros

#define HelloFunctionBegin
 

Functions

int main (int argc, char *argv[])
 

Variables

static char help [] = "...\n\n"
 

Macro Definition Documentation

◆ HelloFunctionBegin

#define HelloFunctionBegin
Value:
MOFEM_LOG_CHANNEL("SYNC"); \
MOFEM_LOG_FUNCTION(); \
MOFEM_LOG_TAG("WORLD", "HelloWorld");
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Examples
hello_world.cpp.

Definition at line 16 of file hello_world.cpp.

16#define HelloFunctionBegin \
17 MoFEMFunctionBegin; \
18 MOFEM_LOG_CHANNEL("SYNC"); \
19 MOFEM_LOG_FUNCTION(); \
20 MOFEM_LOG_TAG("WORLD", "HelloWorld");

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

[set operator to the volume element instance]

[set operator to the volume element instance]

[set operator to the face element instance]

[set operator to the face element instance]

[create skeleton side element and push operator to it]

[create skeleton side element and push operator to it]

[set operator to the face element on skeleton instance]

[set operator to the face element on skeleton instance]

[executing finite elements]

[executing finite elements]

Definition at line 130 of file hello_world.cpp.

130 {
131
132 // initialize petsc
133 MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
134
135 try {
136
137 // Register DM Manager
138 DMType dm_name = "DMMOFEM";
139 CHKERR DMRegister_MoFEM(dm_name);
140
141 // Create MoAB database
142 moab::Core moab_core;
143 moab::Interface &moab = moab_core;
144
145 // Create MoFEM database and link it to MoAB
146 MoFEM::Core mofem_core(moab);
147 MoFEM::Interface &m_field = mofem_core;
148
149 // Simple interface
150 Simple *simple;
151 CHKERR m_field.getInterface(simple);
152
153 // get options from command line
154 CHKERR simple->getOptions();
155 // load mesh file
156 CHKERR simple->loadFile();
157 // add fields
158 CHKERR simple->addDomainField("U", H1, AINSWORTH_LEGENDRE_BASE, 3);
159 CHKERR simple->addBoundaryField("L", H1, AINSWORTH_LEGENDRE_BASE, 3);
160 CHKERR simple->addSkeletonField("S", H1, AINSWORTH_LEGENDRE_BASE, 3);
161 // set fields order
162 CHKERR simple->setFieldOrder("U", 4);
163 CHKERR simple->setFieldOrder("L", 3);
164 CHKERR simple->setFieldOrder("S", 3);
165
166 // setup problem
167 CHKERR simple->setUp();
168
169 auto pipeline_mng = m_field.getInterface<PipelineManager>();
170
171 //! [set operator to the volume element instance]
172 pipeline_mng->getOpDomainRhsPipeline().push_back(new OpRow("U"));
173 pipeline_mng->getOpDomainRhsPipeline().push_back(new OpVolume("U"));
174 pipeline_mng->getOpDomainLhsPipeline().push_back(
175 new OpRowCol("U", "U", true));
176 //! [set operator to the volume element instance]
177
178 //! [set operator to the face element instance]
179 pipeline_mng->getOpBoundaryRhsPipeline().push_back(new OpRow("L"));
180 pipeline_mng->getOpBoundaryRhsPipeline().push_back(new OpFace("L"));
181 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
182 new OpRowCol("U", "L", false));
183 //! [set operator to the face element instance]
184
185 //! [create skeleton side element and push operator to it]
186 boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> side_fe(
188 side_fe->getOpPtrVector().push_back(new OpVolumeSide("U"));
189 //! [create skeleton side element and push operator to it]
190
191 //! [set operator to the face element on skeleton instance]
192 pipeline_mng->getOpSkeletonRhsPipeline().push_back(new OpRow("S"));
193 pipeline_mng->getOpSkeletonRhsPipeline().push_back(
194 new OpFaceSide("S", side_fe));
195 //! [set operator to the face element on skeleton instance]
196
197 //! [executing finite elements]
198 CHKERR pipeline_mng->loopFiniteElements();
199 //! [executing finite elements]
200
202 }
204
205 // finish work cleaning memory, getting statistics, etc.
207
208 return 0;
209}
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition definitions.h:60
@ H1
continuous field
Definition definitions.h:85
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:47
boost::ptr_deque< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
static char help[]
virtual MPI_Comm & get_comm() const =0
Core (interface) class.
Definition Core.hpp:82
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:72
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:112
Deprecated interface functions.
PipelineManager interface.
Simple interface for fast problem set-up.
Definition Simple.hpp:27
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.

Variable Documentation

◆ help

char help[] = "...\n\n"
static

Definition at line 14 of file hello_world.cpp.