v0.13.0
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 43 of file approx_sphere.cpp.

◆ DomainEle

Definition at line 39 of file approx_sphere.cpp.

◆ DomainEleOp

Definition at line 40 of file approx_sphere.cpp.

◆ EntData

Examples
approx_sphere.cpp.

Definition at line 41 of file approx_sphere.cpp.

Function Documentation

◆ main()

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

[Postprocess results]

Examples
approx_sphere.cpp.

Definition at line 469 of file approx_sphere.cpp.

469  {
470 
471  // Initialisation of MoFEM/PETSc and MOAB data structures
472  const char param_file[] = "param_file.petsc";
473  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
474 
475  auto core_log = logging::core::get();
476  core_log->add_sink(
477  LogManager::createSink(LogManager::getStrmWorld(), "EXAMPLE"));
478  LogManager::setLog("EXAMPLE");
479  MOFEM_LOG_TAG("EXAMPLE", "example");
480 
481  try {
482 
483  //! [Register MoFEM discrete manager in PETSc]
484  DMType dm_name = "DMMOFEM";
485  CHKERR DMRegister_MoFEM(dm_name);
486  //! [Register MoFEM discrete manager in PETSc
487 
488  //! [Create MoAB]
489  moab::Core mb_instance; ///< mesh database
490  moab::Interface &moab = mb_instance; ///< mesh database interface
491  //! [Create MoAB]
492 
493  //! [Create MoFEM]
494  MoFEM::Core core(moab); ///< finite element database
495  MoFEM::Interface &m_field = core; ///< finite element database insterface
496  //! [Create MoFEM]
497 
498  //! [ApproxSphere]
499  ApproxSphere ex(m_field);
500  CHKERR ex.runProblem();
501  //! [ApproxSphere]
502  }
503  CATCH_ERRORS;
504 
506 }
std::string param_file
static char help[]
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
#define CHKERR
Inline error check.
Definition: definitions.h:548
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMMoFEM.cpp:59
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:342
CoreTmp< 0 > Core
Definition: Core.hpp:1096
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1965
Core (interface) class.
Definition: Core.hpp:92
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:85
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:125
Deprecated interface functions.

Variable Documentation

◆ a

constexpr double a = 1
constexpr

◆ A

constexpr double A = 6371220
constexpr
Examples
approx_sphere.cpp.

Definition at line 50 of file approx_sphere.cpp.

◆ a2

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

Definition at line 47 of file approx_sphere.cpp.

◆ a4

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

Definition at line 48 of file approx_sphere.cpp.

◆ FM_DIM

constexpr int FM_DIM = 2
constexpr
Examples
approx_sphere.cpp.

Definition at line 29 of file approx_sphere.cpp.

◆ help

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

Definition at line 25 of file approx_sphere.cpp.

◆ i

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

Definition at line 52 of file approx_sphere.cpp.

◆ j

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

Definition at line 53 of file approx_sphere.cpp.

◆ k

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

Definition at line 54 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 67 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 56 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 61 of file approx_sphere.cpp.