v0.14.0
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
MoFEM::EntPolynomialBaseCtx Struct Reference

Class used to pass element data to calculate base functions on tet,triangle,edge. More...

#include <src/approximation/EntPolynomialBaseCtx.hpp>

Inheritance diagram for MoFEM::EntPolynomialBaseCtx:
[legend]
Collaboration diagram for MoFEM::EntPolynomialBaseCtx:
[legend]

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 EntPolynomialBaseCtx (EntitiesFieldData &data, const FieldSpace space, const FieldApproximationBase base, const FieldApproximationBase copy_node_base=LASTBASE)
 
 EntPolynomialBaseCtx (EntitiesFieldData &data, const std::string field_name, const FieldSpace space, const FieldApproximationBase base, const FieldApproximationBase copy_node_base=LASTBASE)
 
- Public Member Functions inherited from MoFEM::BaseFunctionUnknownInterface
virtual ~BaseFunctionUnknownInterface ()=default
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 

Public Attributes

PetscErrorCode(* basePolynomialsType0 )(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
 
PetscErrorCode(* basePolynomialsType1 )(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
 
EntitiesFieldDatadAta
 
const FieldSpace sPace
 
const FieldApproximationBase bAse
 
const std::string fieldName
 
const FieldApproximationBase copyNodeBase
 

Protected Member Functions

MoFEMErrorCode setBase ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version. More...
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version. More...
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version. More...
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version. More...
 

Detailed Description

Class used to pass element data to calculate base functions on tet,triangle,edge.

Examples
EshelbianPlasticity.cpp, and forces_and_sources_testing_users_base.cpp.

Definition at line 22 of file EntPolynomialBaseCtx.hpp.

Constructor & Destructor Documentation

◆ EntPolynomialBaseCtx() [1/2]

EntPolynomialBaseCtx::EntPolynomialBaseCtx ( EntitiesFieldData data,
const FieldSpace  space,
const FieldApproximationBase  base,
const FieldApproximationBase  copy_node_base = LASTBASE 
)

Definition at line 17 of file EntPolynomialBaseCtx.cpp.

21  : dAta(data), sPace(space), bAse(base), copyNodeBase(copy_node_base) {
22  ierr = setBase();
23  CHKERRABORT(PETSC_COMM_WORLD, ierr);
24 }

◆ EntPolynomialBaseCtx() [2/2]

EntPolynomialBaseCtx::EntPolynomialBaseCtx ( EntitiesFieldData data,
const std::string  field_name,
const FieldSpace  space,
const FieldApproximationBase  base,
const FieldApproximationBase  copy_node_base = LASTBASE 
)

Definition at line 26 of file EntPolynomialBaseCtx.cpp.

30  : dAta(data), sPace(space), bAse(base), fieldName(field_name),
31  copyNodeBase(copy_node_base) {
32  ierr = setBase();
33  CHKERRABORT(PETSC_COMM_WORLD, ierr);
34 }

Member Function Documentation

◆ query_interface()

MoFEMErrorCode EntPolynomialBaseCtx::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Reimplemented from MoFEM::BaseFunctionCtx.

Reimplemented in MoFEM::FatPrismPolynomialBaseCtx, and MoFEM::FlatPrismPolynomialBaseCtx.

Definition at line 11 of file EntPolynomialBaseCtx.cpp.

12  {
13  *iface = const_cast<EntPolynomialBaseCtx *>(this);
14  return 0;
15 }

◆ setBase()

MoFEMErrorCode EntPolynomialBaseCtx::setBase ( )
protected

Definition at line 36 of file EntPolynomialBaseCtx.cpp.

36  {
38  switch (bAse) {
40  switch (sPace) {
41  case NOSPACE:
42  case NOFIELD:
43  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Makes no sense");
44  case H1:
45  case HCURL:
46  case HDIV:
47  case L2:
49  break;
50  default:
51  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
52  "Not implemented for this space", FieldSpaceNames[sPace]);
53  }
54  break;
56  switch (sPace) {
57  case NOSPACE:
58  case NOFIELD:
59  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Makes no sense");
60  case H1:
61  case HCURL:
62  case HDIV:
63  case L2:
65  break;
66  default:
67  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
68  "Not implemented for this space", FieldSpaceNames[sPace]);
69  }
70  break;
72  if(fieldName.empty())
73  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Field name not set");
74  switch (sPace) {
75  case NOSPACE:
76  case NOFIELD:
77  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Makes no sense");
78  case H1:
79  case L2:
80  break;
81  default:
82  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
83  "Not implemented for this space", FieldSpaceNames[sPace]);
84  }
85  break;
87  switch (sPace) {
88  case NOSPACE:
89  case NOFIELD:
90  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Makes no sense");
91  case H1:
92  case HCURL:
93  case HDIV:
94  case L2:
96  break;
97  default:
98  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
99  "Not implemented for this space",
101  }
102  break;
103  case USER_BASE:
104  break;
105  default:
106  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
107  "Not implemented for this base <%s>",
109  }
111 }

Member Data Documentation

◆ bAse

const FieldApproximationBase MoFEM::EntPolynomialBaseCtx::bAse

◆ basePolynomialsType0

PetscErrorCode(* MoFEM::EntPolynomialBaseCtx::basePolynomialsType0) (int p, double s, double *diff_s, double *L, double *diffL, const int dim)

Definition at line 27 of file EntPolynomialBaseCtx.hpp.

◆ basePolynomialsType1

PetscErrorCode(* MoFEM::EntPolynomialBaseCtx::basePolynomialsType1) (int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)

Definition at line 31 of file EntPolynomialBaseCtx.hpp.

◆ copyNodeBase

const FieldApproximationBase MoFEM::EntPolynomialBaseCtx::copyNodeBase

Definition at line 40 of file EntPolynomialBaseCtx.hpp.

◆ dAta

EntitiesFieldData& MoFEM::EntPolynomialBaseCtx::dAta

◆ fieldName

const std::string MoFEM::EntPolynomialBaseCtx::fieldName

Definition at line 39 of file EntPolynomialBaseCtx.hpp.

◆ sPace

const FieldSpace MoFEM::EntPolynomialBaseCtx::sPace

Definition at line 37 of file EntPolynomialBaseCtx.hpp.


The documentation for this struct was generated from the following files:
NOSPACE
@ NOSPACE
Definition: definitions.h:83
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
H1
@ H1
continuous field
Definition: definitions.h:85
MoFEM::EntPolynomialBaseCtx
Class used to pass element data to calculate base functions on tet,triangle,edge.
Definition: EntPolynomialBaseCtx.hpp:22
ApproximationBaseNames
const static char *const ApproximationBaseNames[]
Definition: definitions.h:72
L2
@ L2
field with C-1 continuity
Definition: definitions.h:88
MoFEM::EntPolynomialBaseCtx::dAta
EntitiesFieldData & dAta
Definition: EntPolynomialBaseCtx.hpp:36
MoFEM::EntPolynomialBaseCtx::basePolynomialsType1
PetscErrorCode(* basePolynomialsType1)(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Definition: EntPolynomialBaseCtx.hpp:31
USER_BASE
@ USER_BASE
user implemented approximation base
Definition: definitions.h:68
MoFEM::EntPolynomialBaseCtx::copyNodeBase
const FieldApproximationBase copyNodeBase
Definition: EntPolynomialBaseCtx.hpp:40
MoFEM::EntPolynomialBaseCtx::sPace
const FieldSpace sPace
Definition: EntPolynomialBaseCtx.hpp:37
AINSWORTH_LOBATTO_BASE
@ AINSWORTH_LOBATTO_BASE
Definition: definitions.h:62
Legendre_polynomials
PetscErrorCode Legendre_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Legendre approximation basis.
Definition: base_functions.c:15
MoFEM::EntPolynomialBaseCtx::bAse
const FieldApproximationBase bAse
Definition: EntPolynomialBaseCtx.hpp:38
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
AINSWORTH_BERNSTEIN_BEZIER_BASE
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
Definition: definitions.h:64
LobattoKernel_polynomials
PetscErrorCode LobattoKernel_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Kernel Lobatto base functions.
Definition: base_functions.c:345
FieldSpaceNames
const static char *const FieldSpaceNames[]
Definition: definitions.h:92
DEMKOWICZ_JACOBI_BASE
@ DEMKOWICZ_JACOBI_BASE
Definition: definitions.h:66
Jacobi_polynomials
PetscErrorCode Jacobi_polynomials(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Calculate Jacobi approximation basis.
Definition: base_functions.c:67
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
AINSWORTH_LEGENDRE_BASE
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
HCURL
@ HCURL
field with continuous tangents
Definition: definitions.h:86
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::EntPolynomialBaseCtx::fieldName
const std::string fieldName
Definition: EntPolynomialBaseCtx.hpp:39
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
HDIV
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEM::EntPolynomialBaseCtx::basePolynomialsType0
PetscErrorCode(* basePolynomialsType0)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Definition: EntPolynomialBaseCtx.hpp:27
NOFIELD
@ NOFIELD
scalar or vector of scalars describe (no true field)
Definition: definitions.h:84
MoFEM::EntPolynomialBaseCtx::setBase
MoFEMErrorCode setBase()
Definition: EntPolynomialBaseCtx.cpp:36