![]() |
v0.9.0 |
Data operator to do calculations at integration points.Is inherited and implemented by user to do calculations. It can be used in many different ways but typically is used to integrate matrices (f.e. stiffness matrix) and the right hand vector (f.e. force vector). More...
#include <src/finite_elements/ForcesAndSourcesCore.hpp>
Public Types | |
enum | OpType { OPROW = 1 << 0, OPCOL = 1 << 1, OPROWCOL = 1 << 2, OPLAST = 1 << 3 } |
Controls loop over entities on element. More... | |
Public Member Functions | |
UserDataOperator (const FieldSpace space, const char type=OPLAST, 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 NumeredEntFiniteElement > | getNumeredEntFiniteElementPtr () const |
Return raw pointer to NumeredEntFiniteElement. More... | |
EntityHandle | getFEEntityHandle () const |
Return finite element entity handle. More... | |
boost::weak_ptr< SideNumber > | getSideNumberPtr (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 () |
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 FEMethod * | getFEMethod () 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... | |
const std::string & | getFEName () const |
Get name of the element. More... | |
Accessing SNES | |
Vec | getSnesF () const |
Vec | getSnesX () const |
Mat | getSnesA () const |
Mat | getSnesB () const |
Accessing TS | |
Vec | getTSu () const |
Vec | getTSu_t () const |
Vec | getTSf () const |
Mat | getTSA () const |
Mat | getTSB () const |
int | getTSstep () const |
double | getTStime () const |
double | getTSa () const |
Base funtions and integration points | |
MatrixDouble & | getGaussPts () |
matrix of integration (Gauss) points for Volume Element More... | |
auto | getFTensor0IntegrationWeight () |
Get integration weights. More... | |
Deprecated (do not use) | |
DEPRECATED MoFEMErrorCode | getPorblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const |
![]() | |
DataOperator (const bool symm=true, const bool do_vertices=true, const bool do_edges=true, const bool do_quads=true, const bool do_tris=true, const bool do_tets=true, const bool do_prisms=true) | |
virtual | ~DataOperator () |
virtual MoFEMErrorCode | doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data) |
Operator for bi-linear form, usually to calculate values on left hand side. More... | |
virtual MoFEMErrorCode | opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data, bool symm=true) |
virtual MoFEMErrorCode | opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data) |
virtual MoFEMErrorCode | doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data) |
Operator for linear form, usually to calculate values on right hand side. More... | |
virtual MoFEMErrorCode | opRhs (DataForcesAndSourcesCore &data, const bool do_vertices, const bool do_edges, const bool do_quads, const bool do_tris, const bool do_tets, const bool do_prisms, const bool error_if_no_base=true) |
virtual MoFEMErrorCode | opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=true) |
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... | |
Public Attributes | |
char | opType |
std::string | rowFieldName |
std::string | colFieldName |
FieldSpace | sPace |
![]() | |
bool | sYmm |
If true assume that matrix is symmetric structure. More... | |
bool | doVertices |
If false skip vertices. More... | |
bool | doEdges |
If false skip edges. More... | |
bool | doQuads |
bool | doTris |
bool | doTets |
bool | doPrisms |
Protected Member Functions | |
virtual MoFEMErrorCode | setPtrFE (ForcesAndSourcesCore *ptr) |
ForcesAndSourcesCore * | getPtrFE () const |
ForcesAndSourcesCore * | getSidePtrFE () const |
Protected Attributes | |
ForcesAndSourcesCore * | ptrFE |
Private Member Functions | |
MoFEMErrorCode | loopSide (const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim) |
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... | |
Friends | |
class | ForcesAndSourcesCore |
class | EdgeElementForcesAndSourcesCoreBase |
class | FaceElementForcesAndSourcesCoreBase |
class | ContactPrismElementForcesAndSourcesCore |
Data operator to do calculations at integration points.
Is inherited and implemented by user to do calculations. It can be used in many different ways but typically is used to integrate matrices (f.e. stiffness matrix) and the right hand vector (f.e. force vector).
Note: It is assumed that operator is executed for symmetric problem. That means that is executed for not repeating entities on finite element. For example on triangle we have nodes, 3 edges and one face. Because of symmetry calculations are for: nodes-nodes, nodes-edge0, nodes-edge_1, nodes-edge_2, nodes-face, edges_1-edges_1, edges_1-edge_1, edge_1-edge_2, edge_1-edge_1, edge_1-edge_2, edge_2-edge_2, edge_1-face, edge_1-face, edges_3-face, face - face
In case of non symmetric problem in addition calculations of lower off diagonal terms. F.e. edge_1-edge_0, esges_3-edge_0, edge_3-edge_1,
In that case class variable UserDataOperator::sYmm = false;
NoteL: By default sYmm is set for symmetric problems
Definition at line 84 of file ForcesAndSourcesCore.hpp.
Controls loop over entities on element.
OPROW is used if row vector is assembled OPCOL is usually used if column vector is assembled OPROWCOL is usually used for assemble matrices.
For typical problem like Bubnov-Galerkin OPROW and OPCOL are the same. In more general case for example for non-square matrices columns and rows could have different numeration and/or different set of fields.
Enumerator | |
---|---|
OPROW | |
OPCOL | |
OPROWCOL | |
OPLAST |
Definition at line 98 of file ForcesAndSourcesCore.hpp.
MoFEM::ForcesAndSourcesCore::UserDataOperator::UserDataOperator | ( | const FieldSpace | space, |
const char | type = OPLAST , |
||
const bool | symm = true |
||
) |
This Constructor is used typically when some modification base shape functions on some approx. space is applied. Operator is run for all data on space.
User has no access to field data from this operator.
Definition at line 1392 of file ForcesAndSourcesCore.cpp.
MoFEM::ForcesAndSourcesCore::UserDataOperator::UserDataOperator | ( | const std::string & | field_name, |
const char | type, | ||
const bool | symm = true |
||
) |
Definition at line 1397 of file ForcesAndSourcesCore.cpp.
MoFEM::ForcesAndSourcesCore::UserDataOperator::UserDataOperator | ( | const std::string & | row_field_name, |
const std::string & | col_field_name, | ||
const char | type, | ||
const bool | symm = true |
||
) |
Definition at line 1402 of file ForcesAndSourcesCore.cpp.
void MoFEM::ForcesAndSourcesCore::UserDataOperator::addOpType | ( | const OpType | type | ) |
Add operator type.
Definition at line 883 of file ForcesAndSourcesCore.hpp.
EntityHandle MoFEM::ForcesAndSourcesCore::UserDataOperator::getFEEntityHandle | ( | ) | const |
Return finite element entity handle.
Definition at line 841 of file ForcesAndSourcesCore.hpp.
const FEMethod * MoFEM::ForcesAndSourcesCore::UserDataOperator::getFEMethod | ( | ) | const |
Return raw pointer to Finite Element Method object.
Definition at line 873 of file ForcesAndSourcesCore.hpp.
const std::string & MoFEM::ForcesAndSourcesCore::UserDataOperator::getFEName | ( | ) | const |
Get name of the element.
Definition at line 895 of file ForcesAndSourcesCore.hpp.
auto MoFEM::ForcesAndSourcesCore::UserDataOperator::getFTensor0IntegrationWeight | ( | ) |
Get integration weights.
Definition at line 951 of file ForcesAndSourcesCore.hpp.
MatrixDouble & MoFEM::ForcesAndSourcesCore::UserDataOperator::getGaussPts | ( | ) |
matrix of integration (Gauss) points for Volume Element
For triangle: columns 0,1 are x,y coordinates respectively and column 2 is a weight value for example getGaussPts()(1,13) returns y coordinate of 13th Gauss point on particular volume element
For tetrahedron: columns 0,1,2 are x,y,z coordinates respectively and column 3 is a weight value for example getGaussPts()(1,13) returns y coordinate of 13th Gauss point on particular volume element
Definition at line 947 of file ForcesAndSourcesCore.hpp.
int MoFEM::ForcesAndSourcesCore::UserDataOperator::getLoopSize | ( | ) | const |
get size of elements in the loop
Definition at line 891 of file ForcesAndSourcesCore.hpp.
int MoFEM::ForcesAndSourcesCore::UserDataOperator::getNinTheLoop | ( | ) | const |
get number of finite element in the loop
Definition at line 887 of file ForcesAndSourcesCore.hpp.
int MoFEM::ForcesAndSourcesCore::UserDataOperator::getNumberOfNodesOnElement | ( | ) |
Get the number of nodes on finite element.
Definition at line 867 of file ForcesAndSourcesCore.hpp.
boost::shared_ptr< const NumeredEntFiniteElement > MoFEM::ForcesAndSourcesCore::UserDataOperator::getNumeredEntFiniteElementPtr | ( | ) | const |
Return raw pointer to NumeredEntFiniteElement.
Definition at line 837 of file ForcesAndSourcesCore.hpp.
int MoFEM::ForcesAndSourcesCore::UserDataOperator::getOpType | ( | ) | const |
Get operator types.
Definition at line 877 of file ForcesAndSourcesCore.hpp.
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::UserDataOperator::getPorblemRowIndices | ( | const std::string | filed_name, |
const EntityType | type, | ||
const int | side, | ||
VectorInt & | indices | ||
) | const |
Definition at line 956 of file ForcesAndSourcesCore.hpp.
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::UserDataOperator::getProblemColIndices | ( | const std::string | filed_name, |
const EntityType | type, | ||
const int | side, | ||
VectorInt & | indices | ||
) | const |
Get col indices.
Field could be or not declared for this element but is declared for problem
field_name | |
type | entity type |
side | side number, any number if type is MBVERTEX |
NOTE: Using those indices to assemble matrix will result in error if new non-zero values need to be created.
Definition at line 1297 of file ForcesAndSourcesCore.cpp.
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::UserDataOperator::getProblemRowIndices | ( | const std::string | filed_name, |
const EntityType | type, | ||
const int | side, | ||
VectorInt & | indices | ||
) | const |
Get row indices.
Field could be or not declared for this element but is declared for problem
field_name | |
type | entity type |
side | side number, any number if type is MBVERTEX |
NOTE: Using those indices to assemble matrix will result in error if new non-zero values need to be created.
Definition at line 1280 of file ForcesAndSourcesCore.cpp.
|
protected |
Definition at line 962 of file ForcesAndSourcesCore.hpp.
EntityHandle MoFEM::ForcesAndSourcesCore::UserDataOperator::getSideEntity | ( | const int | side_number, |
const EntityType | type | ||
) |
Get the side entity.
side_number | |
type |
Definition at line 859 of file ForcesAndSourcesCore.hpp.
boost::weak_ptr< SideNumber > MoFEM::ForcesAndSourcesCore::UserDataOperator::getSideNumberPtr | ( | const int | side_number, |
const EntityType | type | ||
) |
Get the side number pointer.
side_number | |
type |
Definition at line 846 of file ForcesAndSourcesCore.hpp.
|
protected |
Definition at line 967 of file ForcesAndSourcesCore.hpp.
Mat MoFEM::ForcesAndSourcesCore::UserDataOperator::getSnesA | ( | ) | const |
Definition at line 907 of file ForcesAndSourcesCore.hpp.
Mat MoFEM::ForcesAndSourcesCore::UserDataOperator::getSnesB | ( | ) | const |
Definition at line 911 of file ForcesAndSourcesCore.hpp.
Vec MoFEM::ForcesAndSourcesCore::UserDataOperator::getSnesF | ( | ) | const |
Definition at line 899 of file ForcesAndSourcesCore.hpp.
Vec MoFEM::ForcesAndSourcesCore::UserDataOperator::getSnesX | ( | ) | const |
Definition at line 903 of file ForcesAndSourcesCore.hpp.
Mat MoFEM::ForcesAndSourcesCore::UserDataOperator::getTSA | ( | ) | const |
Definition at line 927 of file ForcesAndSourcesCore.hpp.
double MoFEM::ForcesAndSourcesCore::UserDataOperator::getTSa | ( | ) | const |
Definition at line 943 of file ForcesAndSourcesCore.hpp.
Mat MoFEM::ForcesAndSourcesCore::UserDataOperator::getTSB | ( | ) | const |
Definition at line 931 of file ForcesAndSourcesCore.hpp.
Vec MoFEM::ForcesAndSourcesCore::UserDataOperator::getTSf | ( | ) | const |
Definition at line 923 of file ForcesAndSourcesCore.hpp.
int MoFEM::ForcesAndSourcesCore::UserDataOperator::getTSstep | ( | ) | const |
Definition at line 935 of file ForcesAndSourcesCore.hpp.
double MoFEM::ForcesAndSourcesCore::UserDataOperator::getTStime | ( | ) | const |
Definition at line 939 of file ForcesAndSourcesCore.hpp.
Vec MoFEM::ForcesAndSourcesCore::UserDataOperator::getTSu | ( | ) | const |
Definition at line 915 of file ForcesAndSourcesCore.hpp.
Vec MoFEM::ForcesAndSourcesCore::UserDataOperator::getTSu_t | ( | ) | const |
Definition at line 919 of file ForcesAndSourcesCore.hpp.
|
private |
User call this function to loop over elements on the side of face. This function calls finite element with is operator to do calculations.
fe_name | |
side_fe | |
dim |
Definition at line 1322 of file ForcesAndSourcesCore.cpp.
void MoFEM::ForcesAndSourcesCore::UserDataOperator::setOpType | ( | const OpType | type | ) |
Set operator type.
Operator | type |
Definition at line 879 of file ForcesAndSourcesCore.hpp.
|
protectedvirtual |
Reimplemented in MoFEM::FaceElementForcesAndSourcesCoreBase::UserDataOperator, MoFEM::VolumeElementForcesAndSourcesCoreBase::UserDataOperator, MoFEM::FatPrismElementForcesAndSourcesCore::UserDataOperator, MoFEM::VolumeElementForcesAndSourcesCoreOnSideBase::UserDataOperator, MoFEM::FlatPrismElementForcesAndSourcesCore::UserDataOperator, MoFEM::EdgeElementForcesAndSourcesCoreBase::UserDataOperator, MoFEM::FaceElementForcesAndSourcesCoreOnSideBase::UserDataOperator, and MoFEM::VertexElementForcesAndSourcesCore::UserDataOperator.
Definition at line 1434 of file ForcesAndSourcesCore.cpp.
|
friend |
Definition at line 374 of file ForcesAndSourcesCore.hpp.
|
friend |
Definition at line 372 of file ForcesAndSourcesCore.hpp.
|
friend |
Definition at line 373 of file ForcesAndSourcesCore.hpp.
|
friend |
Definition at line 371 of file ForcesAndSourcesCore.hpp.
std::string MoFEM::ForcesAndSourcesCore::UserDataOperator::colFieldName |
Definition at line 107 of file ForcesAndSourcesCore.hpp.
char MoFEM::ForcesAndSourcesCore::UserDataOperator::opType |
Definition at line 105 of file ForcesAndSourcesCore.hpp.
|
protected |
Definition at line 349 of file ForcesAndSourcesCore.hpp.
std::string MoFEM::ForcesAndSourcesCore::UserDataOperator::rowFieldName |
Definition at line 106 of file ForcesAndSourcesCore.hpp.
FieldSpace MoFEM::ForcesAndSourcesCore::UserDataOperator::sPace |
Definition at line 108 of file ForcesAndSourcesCore.hpp.