v0.14.0
Loading...
Searching...
No Matches
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
 

Functions

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

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

◆ DomainEle

Definition at line 23 of file approx_sphere.cpp.

◆ DomainEleOp

Definition at line 24 of file approx_sphere.cpp.

◆ EntData

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]

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(
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.
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:47
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
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.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.

Variable Documentation

◆ a

constexpr double a = 1
constexpr

◆ A

constexpr double A = 6371220
constexpr

Definition at line 34 of file approx_sphere.cpp.

◆ a2

constexpr double a2 = a * a
constexpr

Definition at line 31 of file approx_sphere.cpp.

◆ a4

constexpr double a4 = a2 * a2
constexpr

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

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.

51 {
52 const double res = res_J(x, y, z);
54
55 (res * 2 + (4 * x * x)),
56 (4 * y * x),
57 (4 * z * x),
58
59 (4 * x * y),
60 (2 * res + (4 * y * y)),
61 (4 * z * y),
62
63 (4 * x * z),
64 (4 * y * z),
65 (2 * res + (4 * z * z))};
66};

◆ 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.

40 {
41 const double res = (x * x + y * y + z * z - a2);
42 return res;
43};

◆ 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.

45 {
46 const double res = res_J(x, y, z);
47 return FTensor::Tensor1<double, 3>{res * (2 * x), res * (2 * y),
48 res * (2 * z)};
49};