v0.13.1
Classes | Typedefs | Functions | Variables
approx_sphere.cpp File Reference
#include <MoFEM.hpp>
#include <BasicFiniteElements.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  ElementsAndOps< 2 >
 
struct  OpRhs
 
struct  OpLhs
 
struct  OpError
 
struct  ApproxSphere
 

Typedefs

using DomainEle = ElementsAndOps< FM_DIM >::DomainEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using EntData = EntitiesFieldData::EntData
 
using AssemblyDomainEleOp = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::OpBase
 

Functions

int main (int argc, char *argv[])
 [Postprocess results] More...
 

Variables

static char help [] = "...\n\n"
 
constexpr int FM_DIM = 2
 
constexpr double a = 1
 
constexpr double a2 = a * a
 
constexpr double a4 = a2 * a2
 
constexpr double A = 6371220
 
FTensor::Index< 'i', 3 > i
 
FTensor::Index< 'j', 3 > j
 
FTensor::Index< 'k', 3 > k
 
auto res_J
 
auto res_J_dx
 
auto lhs_J_dx2
 

Typedef Documentation

◆ AssemblyDomainEleOp

Definition at line 27 of file approx_sphere.cpp.

◆ DomainEle

Definition at line 23 of file approx_sphere.cpp.

◆ DomainEleOp

Definition at line 24 of file approx_sphere.cpp.

◆ EntData

Examples
approx_sphere.cpp.

Definition at line 25 of file approx_sphere.cpp.

Function Documentation

◆ main()

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

[Postprocess results]

Examples
approx_sphere.cpp.

Definition at line 473 of file approx_sphere.cpp.

473 {
474
475 // Initialisation of MoFEM/PETSc and MOAB data structures
476 const char param_file[] = "param_file.petsc";
478
479 auto core_log = logging::core::get();
480 core_log->add_sink(
481 LogManager::createSink(LogManager::getStrmWorld(), "EXAMPLE"));
482 LogManager::setLog("EXAMPLE");
483 MOFEM_LOG_TAG("EXAMPLE", "example");
484
485 try {
486
487 //! [Register MoFEM discrete manager in PETSc]
488 DMType dm_name = "DMMOFEM";
489 CHKERR DMRegister_MoFEM(dm_name);
490 //! [Register MoFEM discrete manager in PETSc
491
492 //! [Create MoAB]
493 moab::Core mb_instance; ///< mesh database
494 moab::Interface &moab = mb_instance; ///< mesh database interface
495 //! [Create MoAB]
496
497 //! [Create MoFEM]
498 MoFEM::Core core(moab); ///< finite element database
499 MoFEM::Interface &m_field = core; ///< finite element database insterface
500 //! [Create MoFEM]
501
502 //! [ApproxSphere]
503 ApproxSphere ex(m_field);
504 CHKERR ex.runProblem();
505 //! [ApproxSphere]
506 }
508
510}
std::string param_file
static char help[]
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
#define CHKERR
Inline error check.
Definition: definitions.h:535
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMMoFEM.cpp:47
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:332
CoreTmp< 0 > Core
Definition: Core.hpp:1086
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1955
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.

Variable Documentation

◆ a

constexpr double a = 1
constexpr

◆ A

constexpr double A = 6371220
constexpr
Examples
approx_sphere.cpp.

Definition at line 34 of file approx_sphere.cpp.

◆ a2

constexpr double a2 = a * a
constexpr
Examples
approx_sphere.cpp.

Definition at line 31 of file approx_sphere.cpp.

◆ a4

constexpr double a4 = a2 * a2
constexpr
Examples
approx_sphere.cpp.

Definition at line 32 of file approx_sphere.cpp.

◆ FM_DIM

constexpr int FM_DIM = 2
constexpr
Examples
approx_sphere.cpp.

Definition at line 15 of file approx_sphere.cpp.

◆ help

char help[] = "...\n\n"
static
Examples
approx_sphere.cpp.

Definition at line 11 of file approx_sphere.cpp.

◆ i

FTensor::Index<'i', 3> i
Examples
approx_sphere.cpp.

Definition at line 36 of file approx_sphere.cpp.

◆ j

FTensor::Index<'j', 3> j
Examples
approx_sphere.cpp.

Definition at line 37 of file approx_sphere.cpp.

◆ k

FTensor::Index<'k', 3> k
Examples
approx_sphere.cpp.

Definition at line 38 of file approx_sphere.cpp.

◆ lhs_J_dx2

auto lhs_J_dx2
Initial value:
= [](const double x, const double y, const double z) {
const double res = res_J(x, y, z);
(res * 2 + (4 * x * x)),
(4 * y * x),
(4 * z * x),
(4 * x * y),
(2 * res + (4 * y * y)),
(4 * z * y),
(4 * x * z),
(4 * y * z),
(2 * res + (4 * z * z))};
}
auto res_J
Examples
approx_sphere.cpp.

Definition at line 51 of file approx_sphere.cpp.

◆ res_J

auto res_J
Initial value:
= [](const double x, const double y, const double z) {
const double res = (x * x + y * y + z * z - a2);
return res;
}
constexpr double a2
Examples
approx_sphere.cpp.

Definition at line 40 of file approx_sphere.cpp.

◆ res_J_dx

auto res_J_dx
Initial value:
= [](const double x, const double y, const double z) {
const double res = res_J(x, y, z);
return FTensor::Tensor1<double, 3>{res * (2 * x), res * (2 * y),
res * (2 * z)};
}
Examples
approx_sphere.cpp.

Definition at line 45 of file approx_sphere.cpp.