v0.13.1
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator Struct Reference

default operator for TRI element More...

#include <src/finite_elements/FaceElementForcesAndSourcesCore.hpp>

Inheritance diagram for MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator:
[legend]
Collaboration diagram for MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator:
[legend]

Public Member Functions

double getArea ()
 get area of face More...
 
double getMeasure ()
 get measure of element More...
 
VectorDoublegetNormal ()
 get triangle normal More...
 
VectorDoublegetTangent1 ()
 get triangle tangent 1 More...
 
VectorDoublegetTangent2 ()
 get triangle tangent 2 More...
 
auto getFTensor1Normal ()
 get normal as tensor More...
 
auto getFTensor1Tangent1 ()
 get tangentOne as tensor More...
 
auto getFTensor1Tangent2 ()
 get tangentTwo as tensor More...
 
int getNumNodes ()
 get element number of nodes More...
 
const EntityHandlegetConn ()
 get element connectivity More...
 
VectorDoublegetCoords ()
 get triangle coordinates More...
 
auto getFTensor1Coords ()
 get get coords at gauss points More...
 
MatrixDoublegetNormalsAtGaussPts ()
 if higher order geometry return normals at Gauss pts. More...
 
ublas::matrix_row< MatrixDoublegetNormalsAtGaussPts (const int gg)
 if higher order geometry return normals at Gauss pts. More...
 
MatrixDoublegetTangent1AtGaussPts ()
 if higher order geometry return tangent vector to triangle at Gauss pts. More...
 
MatrixDoublegetTangent2AtGaussPts ()
 if higher order geometry return tangent vector to triangle at Gauss pts. More...
 
auto getFTensor1NormalsAtGaussPts ()
 get normal at integration points More...
 
auto getFTensor1Tangent1AtGaussPts ()
 get tangent 1 at integration points More...
 
auto getFTensor1Tangent2AtGaussPts ()
 get tangent 2 at integration points More...
 
FaceElementForcesAndSourcesCoregetFaceFE ()
 return pointer to Generic Triangle Finite Element object More...
 
MoFEMErrorCode loopSideVolumes (const string fe_name, VolumeElementForcesAndSourcesCoreOnSide &fe_method)
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPSPACE, const bool symm=true)
 
 UserDataOperator (const std::string field_name, const char type, const bool symm=true)
 
 UserDataOperator (const std::string row_field_name, const std::string col_field_name, const char type, const bool symm=true)
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement. More...
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle. More...
 
int getFEDim () const
 Get dimension of finite element. More...
 
EntityType getFEType () const
 Get dimension of finite element. More...
 
boost::weak_ptr< SideNumbergetSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer. More...
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity. More...
 
int getNumberOfNodesOnElement () const
 Get the number of nodes on finite element. More...
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices. More...
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices. More...
 
const FEMethodgetFEMethod () const
 Return raw pointer to Finite Element Method object. More...
 
int getOpType () const
 Get operator types. More...
 
void setOpType (const OpType type)
 Set operator type. More...
 
void addOpType (const OpType type)
 Add operator type. More...
 
int getNinTheLoop () const
 get number of finite element in the loop More...
 
int getLoopSize () const
 get size of elements in the loop More...
 
std::string getFEName () const
 Get name of the element. More...
 
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
ForcesAndSourcesCoregetRefinePtrFE () const
 
const PetscData::SwitchesgetDataCtx () const
 
const KspMethod::KSPContext getKSPCtx () const
 
const SnesMethod::SNESContext getSNESCtx () const
 
const TSMethod::TSContext getTSCtx () const
 
Vec getKSPf () const
 
Mat getKSPA () const
 
Mat getKSPB () const
 
Vec getSNESf () const
 
Vec getSNESx () const
 
Mat getSNESA () const
 
Mat getSNESB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSu_tt () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTStimeStep () const
 
double getTSa () const
 
double getTSaa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element More...
 
auto getFTensor0IntegrationWeight ()
 Get integration weights. More...
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3) More...
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry. More...
 
double getMeasure () const
 get measure of element More...
 
doublegetMeasure ()
 get measure of element More...
 
MoFEMErrorCode loopSide (const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim, const EntityHandle ent_for_side=0, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over elements on the side of face. This function calls finite element with is operator to do calculations. More...
 
MoFEMErrorCode loopThis (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over parent elements. This function calls finite element with is operator to do calculations. More...
 
MoFEMErrorCode loopParent (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over parent elements. This function calls finite element with is operator to do calculations. More...
 
MoFEMErrorCode loopChildren (const string &fe_name, ForcesAndSourcesCore *child_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over parent elements. This function calls finite element with is operator to do calculations. More...
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
virtual MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &data, const bool error_if_no_base=false)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not. More...
 
void setSymm ()
 set if operator is executed taking in account symmetry More...
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem More...
 

Private Member Functions

MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 

Additional Inherited Members

- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType {
  OPROW = 1 << 0 , OPCOL = 1 << 1 , OPROWCOL = 1 << 2 , OPSPACE = 1 << 3 ,
  OPLAST = 1 << 3
}
 Controls loop over entities on element. More...
 
- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)>
 
using DoWorkRhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int side, EntityType type, EntitiesFieldData::EntData &data)>
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- Public Attributes inherited from MoFEM::DataOperator
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
bool sYmm
 If true assume that matrix is symmetric structure. More...
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity. More...
 
booldoVertices
 \deprectaed If false skip vertices More...
 
booldoEdges
 \deprectaed If false skip edges More...
 
booldoQuads
 \deprectaed More...
 
booldoTris
 \deprectaed More...
 
booldoTets
 \deprectaed More...
 
booldoPrisms
 \deprectaed More...
 
- Static Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
static const char *const OpTypeNames []
 
virtual MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

default operator for TRI element

Examples
MagneticElement.hpp, NavierStokesElement.hpp, PoissonDiscontinousGalerkin.hpp, UnsaturatedFlow.hpp, boundary_marker.cpp, child_and_parent.cpp, contact.cpp, continuity_check_on_skeleton_3d.cpp, field_evaluator.cpp, free_surface.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, hello_world.cpp, nonlinear_elastic.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.hpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, simple_contact_thermal.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, test_cache_on_entities.cpp, thermo_elastic.cpp, and wave_equation.cpp.

Definition at line 95 of file FaceElementForcesAndSourcesCore.hpp.

Member Function Documentation

◆ getArea()

double FaceElementForcesAndSourcesCore::UserDataOperator::getArea ( )
inline

◆ getConn()

const EntityHandle * FaceElementForcesAndSourcesCore::UserDataOperator::getConn ( )
inline

get element connectivity

Definition at line 286 of file FaceElementForcesAndSourcesCore.hpp.

286 {
287 return static_cast<FaceElementForcesAndSourcesCore *>(ptrFE)->conn;
288}

◆ getCoords()

VectorDouble & FaceElementForcesAndSourcesCore::UserDataOperator::getCoords ( )
inline

get triangle coordinates

Examples
scalar_check_approximation.cpp.

Definition at line 290 of file FaceElementForcesAndSourcesCore.hpp.

◆ getFaceFE()

FaceElementForcesAndSourcesCore * FaceElementForcesAndSourcesCore::UserDataOperator::getFaceFE ( )
inline

return pointer to Generic Triangle Finite Element object

Definition at line 348 of file FaceElementForcesAndSourcesCore.hpp.

348 {
349 return static_cast<FaceElementForcesAndSourcesCore *>(ptrFE);
350}

◆ getFTensor1Coords()

auto FaceElementForcesAndSourcesCore::UserDataOperator::getFTensor1Coords ( )
inline

get get coords at gauss points

auto t_coords = getFTensor1Coords();
t_center(i) = 0;
for(int nn = 0;nn!=3;nn++) {
t_center(i) += t_coords(i);
++t_coords;
}
t_center(i) /= 3;
FTensor::Index< 'i', SPACE_DIM > i

Definition at line 294 of file FaceElementForcesAndSourcesCore.hpp.

294 {
295 double *ptr = &*getCoords().data().begin();
297 &ptr[2]);
298}

◆ getFTensor1Normal()

auto FaceElementForcesAndSourcesCore::UserDataOperator::getFTensor1Normal ( )
inline

get normal as tensor

Examples
PoissonDiscontinousGalerkin.hpp, UnsaturatedFlow.hpp, plate.cpp, and simple_elasticity.cpp.

Definition at line 266 of file FaceElementForcesAndSourcesCore.hpp.

266 {
267 double *ptr = &*getNormal().data().begin();
268 return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2]);
269}

◆ getFTensor1NormalsAtGaussPts()

auto FaceElementForcesAndSourcesCore::UserDataOperator::getFTensor1NormalsAtGaussPts ( )
inline

get normal at integration points

Example:

double nrm2;
auto t_normal = getFTensor1NormalsAtGaussPts();
for(int gg = gg!=data.getN().size1();gg++) {
nrm2 = sqrt(t_normal(i)*t_normal(i));
++t_normal;
}
Examples
simple_interface.cpp.

Definition at line 326 of file FaceElementForcesAndSourcesCore.hpp.

327 {
328 double *ptr = &*getNormalsAtGaussPts().data().begin();
330 &ptr[2]);
331}
MatrixDouble & getNormalsAtGaussPts()
if higher order geometry return normals at Gauss pts.

◆ getFTensor1Tangent1()

auto FaceElementForcesAndSourcesCore::UserDataOperator::getFTensor1Tangent1 ( )
inline

get tangentOne as tensor

Definition at line 271 of file FaceElementForcesAndSourcesCore.hpp.

271 {
272 double *ptr = &*getTangent1().data().begin();
273 return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2]);
274}

◆ getFTensor1Tangent1AtGaussPts()

auto FaceElementForcesAndSourcesCore::UserDataOperator::getFTensor1Tangent1AtGaussPts ( )
inline

get tangent 1 at integration points

Definition at line 333 of file FaceElementForcesAndSourcesCore.hpp.

334 {
335 double *ptr = &*getTangent1AtGaussPts().data().begin();
337 &ptr[2]);
338}
MatrixDouble & getTangent1AtGaussPts()
if higher order geometry return tangent vector to triangle at Gauss pts.

◆ getFTensor1Tangent2()

auto FaceElementForcesAndSourcesCore::UserDataOperator::getFTensor1Tangent2 ( )
inline

get tangentTwo as tensor

Definition at line 276 of file FaceElementForcesAndSourcesCore.hpp.

276 {
277 double *ptr = &*getTangent2().data().begin();
278 return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2]);
279}

◆ getFTensor1Tangent2AtGaussPts()

auto FaceElementForcesAndSourcesCore::UserDataOperator::getFTensor1Tangent2AtGaussPts ( )
inline

get tangent 2 at integration points

Definition at line 340 of file FaceElementForcesAndSourcesCore.hpp.

341 {
342 double *ptr = &*getTangent2AtGaussPts().data().begin();
344 &ptr[2]);
345}
MatrixDouble & getTangent2AtGaussPts()
if higher order geometry return tangent vector to triangle at Gauss pts.

◆ getMeasure()

double FaceElementForcesAndSourcesCore::UserDataOperator::getMeasure ( )
inline

◆ getNormal()

VectorDouble & FaceElementForcesAndSourcesCore::UserDataOperator::getNormal ( )
inline

get triangle normal

Examples
UnsaturatedFlow.hpp, and hello_world.cpp.

Definition at line 254 of file FaceElementForcesAndSourcesCore.hpp.

◆ getNormalsAtGaussPts() [1/2]

MatrixDouble & FaceElementForcesAndSourcesCore::UserDataOperator::getNormalsAtGaussPts ( )
inline

if higher order geometry return normals at Gauss pts.

Note: returned matrix has size 0 in rows and columns if no HO approximation of geometry is available.

Examples
MagneticElement.hpp.

Definition at line 301 of file FaceElementForcesAndSourcesCore.hpp.

◆ getNormalsAtGaussPts() [2/2]

ublas::matrix_row< MatrixDouble > FaceElementForcesAndSourcesCore::UserDataOperator::getNormalsAtGaussPts ( const int  gg)
inline

if higher order geometry return normals at Gauss pts.

Parameters
gggauss point number

Definition at line 307 of file FaceElementForcesAndSourcesCore.hpp.

308 {
309 return ublas::matrix_row<MatrixDouble>(
311 gg);
312}

◆ getNumNodes()

int FaceElementForcesAndSourcesCore::UserDataOperator::getNumNodes ( )
inline

get element number of nodes

Definition at line 281 of file FaceElementForcesAndSourcesCore.hpp.

◆ getTangent1()

VectorDouble & FaceElementForcesAndSourcesCore::UserDataOperator::getTangent1 ( )
inline

get triangle tangent 1

Definition at line 258 of file FaceElementForcesAndSourcesCore.hpp.

◆ getTangent1AtGaussPts()

MatrixDouble & FaceElementForcesAndSourcesCore::UserDataOperator::getTangent1AtGaussPts ( )
inline

if higher order geometry return tangent vector to triangle at Gauss pts.

Note: returned matrix has size 0 in rows and columns if no HO approximation of geometry is avaliable.

Definition at line 315 of file FaceElementForcesAndSourcesCore.hpp.

◆ getTangent2()

VectorDouble & FaceElementForcesAndSourcesCore::UserDataOperator::getTangent2 ( )
inline

get triangle tangent 2

Definition at line 262 of file FaceElementForcesAndSourcesCore.hpp.

◆ getTangent2AtGaussPts()

MatrixDouble & FaceElementForcesAndSourcesCore::UserDataOperator::getTangent2AtGaussPts ( )
inline

if higher order geometry return tangent vector to triangle at Gauss pts.

Note: returned matrix has size 0 in rows and columns if no HO approximation of geometry is avaliable.

Definition at line 321 of file FaceElementForcesAndSourcesCore.hpp.

◆ loopSideVolumes()

MoFEMErrorCode FaceElementForcesAndSourcesCore::UserDataOperator::loopSideVolumes ( const string  fe_name,
VolumeElementForcesAndSourcesCoreOnSide fe_method 
)

User call this function to loop over elements on the side of face. This function calls MoFEM::VolumeElementForcesAndSourcesCoreOnSide with is operator to do calculations.

Parameters
fe_nameName of the element
methodFinite element object
Returns
error code
Examples
photon_diffusion.cpp.

Definition at line 432 of file FaceElementForcesAndSourcesCore.cpp.

433 {
434 return loopSide(fe_name, &fe_method, 3);
435}
MoFEMErrorCode loopSide(const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim, const EntityHandle ent_for_side=0, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
User call this function to loop over elements on the side of face. This function calls finite element...

◆ setPtrFE()

MoFEMErrorCode FaceElementForcesAndSourcesCore::UserDataOperator::setPtrFE ( ForcesAndSourcesCore ptr)
privatevirtual

Reimplemented from MoFEM::ForcesAndSourcesCore::UserDataOperator.

Reimplemented in MoFEM::FaceElementForcesAndSourcesCoreOnSide::UserDataOperator.

Definition at line 382 of file FaceElementForcesAndSourcesCore.cpp.

383 {
385 if (!(ptrFE = dynamic_cast<FaceElementForcesAndSourcesCore *>(ptr)))
386 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
387 "User operator and finite element do not work together");
389}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440

The documentation for this struct was generated from the following files: