v0.14.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 28 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]

[Register MoFEM discrete manager in PETSc]

[Register MoFEM discrete manager in PETSc

[Create MoAB]

< mesh database

< mesh database interface

[Create MoAB]

[Create MoFEM]

< finite element database

< finite element database insterface

[Create MoFEM]

[ApproxSphere]

[ApproxSphere]

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";
477  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
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  }
507  CATCH_ERRORS;
508 
510 }

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))};
}
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;
}
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.

help
static char help[]
Definition: approx_sphere.cpp:11
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
FTensor::Tensor1< double, 3 >
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
FTensor::Tensor2< double, 3, 3 >
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:47
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
MoFEM::CoreTmp< 0 >::Initialize
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
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1094
a2
constexpr double a2
Definition: approx_sphere.cpp:31
ApproxSphere
Definition: approx_sphere.cpp:262
res_J
auto res_J
Definition: approx_sphere.cpp:40