![]() |
v0.14.0 |
Basic algebra on fields. More...
#include <src/interfaces/FieldBlas.hpp>
Public Types | |
using | OneFieldFunctionOnValues = boost::function< double(const double field_val)> |
function to set a field value More... | |
using | OneFieldFunctionOnEntities = boost::function< MoFEMErrorCode(boost::shared_ptr< FieldEntity > field_entity_ptr)> |
using | TwoFieldFunctionOnValues = boost::function< double(const double y_field_value_reference, const double x_field_value)> |
using | TwoFieldFunctionOnEntities = boost::function< MoFEMErrorCode(boost::shared_ptr< FieldEntity > y_field_entity_ptr, const boost::shared_ptr< FieldEntity > x_field_entity_ptr)> |
using | VertexCoordsFunction = boost::function< MoFEMErrorCode(VectorAdaptor &&field_data, double *xcoord, double *ycoord, double *zcoord)> |
Public Member Functions | |
MoFEMErrorCode | query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const |
FieldBlas (const MoFEM::Core &core) | |
~FieldBlas ()=default | |
MoFEMErrorCode | fieldLambdaOnEntities (OneFieldFunctionOnEntities lambda, const std::string field_name, Range *ents_ptr=nullptr) |
filed lambda More... | |
MoFEMErrorCode | fieldLambdaOnValues (OneFieldFunctionOnValues lambda, const std::string field_name, Range *ents_ptr=nullptr) |
filed lambda More... | |
MoFEMErrorCode | fieldLambdaOnValues (TwoFieldFunctionOnValues lambda, const std::string field_name_x, const std::string field_name_y, bool error_if_missing=false, Range *ents_ptr=nullptr) |
filed lambda More... | |
MoFEMErrorCode | fieldLambdaOnEntities (TwoFieldFunctionOnEntities lambda, const std::string field_name_x, const std::string field_name_y, bool error_if_missing=false, Range *ents_ptr=nullptr) |
filed lambda More... | |
DEPRECATED MoFEMErrorCode | fieldLambda (TwoFieldFunctionOnValues lambda, const std::string field_name_x, const std::string field_name_y, bool error_if_missing, bool create_if_missing) |
MoFEMErrorCode | fieldAxpy (const double alpha, const std::string field_name_x, const std::string field_name_y, bool error_if_missing=false, Range *ents_ptr=nullptr) |
axpy fields More... | |
DEPRECATED MoFEMErrorCode | fieldAxpy (const double alpha, const std::string field_name_x, const std::string field_name_y, bool error_if_missing, bool create_if_missing) |
MoFEMErrorCode | fieldCopy (const double alpha, const std::string field_name_x, const std::string field_name_y, bool error_if_missing=false, Range *ents_ptr=nullptr) |
copy and scale fields More... | |
DEPRECATED MoFEMErrorCode | fieldCopy (const double alpha, const std::string field_name_x, const std::string field_name_y, bool error_if_missing, bool create_if_missing) |
MoFEMErrorCode | fieldScale (const double alpha, const std::string field_name, Range *ents_ptr=nullptr) |
field scale More... | |
MoFEMErrorCode | setVertexDofs (VertexCoordsFunction lambda, const std::string field_name, Range *verts=nullptr) |
Set DOFs on vertices using user function. More... | |
MoFEMErrorCode | setField (const double val, const EntityType type, const std::string field_name) |
MoFEMErrorCode | setField (const double val, const EntityType type, const Range &ents, const std::string field_name) |
set field More... | |
MoFEMErrorCode | setField (const double val, const std::string field_name) |
set field More... | |
![]() | |
virtual MoFEMErrorCode | query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const =0 |
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 | |
const MoFEM::Interface & | cOre |
bool | dEbug |
Additional Inherited Members | |
![]() | |
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... | |
Basic algebra on fields.
Definition at line 21 of file FieldBlas.hpp.
using MoFEM::FieldBlas::OneFieldFunctionOnEntities = boost::function<MoFEMErrorCode( boost::shared_ptr<FieldEntity> field_entity_ptr)> |
Definition at line 44 of file FieldBlas.hpp.
using MoFEM::FieldBlas::OneFieldFunctionOnValues = boost::function<double(const double field_val)> |
function to set a field value
Definition at line 37 of file FieldBlas.hpp.
using MoFEM::FieldBlas::TwoFieldFunctionOnEntities = boost::function<MoFEMErrorCode( boost::shared_ptr<FieldEntity> y_field_entity_ptr, const boost::shared_ptr<FieldEntity> x_field_entity_ptr)> |
y_field_entity_ptr | pointer to second "y_field" field entities |
x_field_entity_ptr | pointer to first "x_field" field entities |
Definition at line 60 of file FieldBlas.hpp.
using MoFEM::FieldBlas::TwoFieldFunctionOnValues = boost::function<double( const double y_field_value_reference, const double x_field_value)> |
y_field_value_reference | field "y_field" values |
x_field_value |
Definition at line 52 of file FieldBlas.hpp.
using MoFEM::FieldBlas::VertexCoordsFunction = boost::function<MoFEMErrorCode(VectorAdaptor &&field_data, double *xcoord, double *ycoord, double *zcoord)> |
Definition at line 280 of file FieldBlas.hpp.
MoFEM::FieldBlas::FieldBlas | ( | const MoFEM::Core & | core | ) |
Definition at line 17 of file FieldBlas.cpp.
|
default |
MoFEMErrorCode MoFEM::FieldBlas::fieldAxpy | ( | const double | alpha, |
const std::string | field_name_x, | ||
const std::string | field_name_y, | ||
bool | error_if_missing, | ||
bool | create_if_missing | ||
) |
field_y = field_y + alpha*field_x
alpha | |
field_name_x | name of field_x |
field_name_y | name of field_y |
error_if_missing | throw error if entity/dof exist in field_x but not on field_y |
create_if_missing | creat dof in field_y from field_x if it is not database |
Definition at line 280 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::fieldAxpy | ( | const double | alpha, |
const std::string | field_name_x, | ||
const std::string | field_name_y, | ||
bool | error_if_missing = false , |
||
Range * | ents_ptr = nullptr |
||
) |
axpy fields
field_y = field_y + alpha*field_x
alpha | |
field_name_x | name of field_x |
field_name_y | name of field_y |
error_if_missing | throw error if entity/dof exist in field_x but not |
ents_ptr | execute lambda function only on entities given by pointer on field_y |
Definition at line 267 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::fieldCopy | ( | const double | alpha, |
const std::string | field_name_x, | ||
const std::string | field_name_y, | ||
bool | error_if_missing, | ||
bool | create_if_missing | ||
) |
Definition at line 299 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::fieldCopy | ( | const double | alpha, |
const std::string | field_name_x, | ||
const std::string | field_name_y, | ||
bool | error_if_missing = false , |
||
Range * | ents_ptr = nullptr |
||
) |
copy and scale fields
field_y = alpha*field_x
alpha | |
field_name_x | name of field_x |
field_name_y | name of field_y |
error_if_missing | throw error if entity/dof exist in field_x but not |
ents_ptr | execute lambda function only on entities given by pointer on field_y |
create_if_missing | creat dof in field_y from field_x if it is not database |
Definition at line 288 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::fieldLambda | ( | TwoFieldFunctionOnValues | lambda, |
const std::string | field_name_x, | ||
const std::string | field_name_y, | ||
bool | error_if_missing, | ||
bool | create_if_missing | ||
) |
lambda | |
field_name_x | |
field_name_y | |
error_if_missing | |
create_if_missing |
Definition at line 255 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::fieldLambdaOnEntities | ( | FieldBlas::OneFieldFunctionOnEntities | lambda, |
const std::string | field_name, | ||
Range * | ents_ptr = nullptr |
||
) |
filed lambda
Do calculation on one field using lambda function with entity field input
function | f(double &x, double) |
field_name | name of field |
ents_ptr | execute lambda function only on entities given by pointer to range |
Definition at line 50 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::fieldLambdaOnEntities | ( | FieldBlas::TwoFieldFunctionOnEntities | lambda, |
const std::string | field_name_x, | ||
const std::string | field_name_y, | ||
bool | error_if_missing = false , |
||
Range * | ents_ptr = nullptr |
||
) |
filed lambda
Do calculation on two fields and save result to field fy input function usees field entities
function | f(double &x, double) |
field_name_x | name of field_x |
field_name_y | name of field_y |
error_if_missing | throw error if missing entities of field y |
ents_ptr | execute lambda function only on entities given by pointer to range |
Definition at line 158 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::fieldLambdaOnValues | ( | FieldBlas::OneFieldFunctionOnValues | lambda, |
const std::string | field_name, | ||
Range * | ents_ptr = nullptr |
||
) |
filed lambda
Do calculation on one field using lambda function with field value input
function | f(const double) |
field_name | name of field |
ents_ptr | execute lambda function only on entities given by pointer to range |
Definition at line 21 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::fieldLambdaOnValues | ( | FieldBlas::TwoFieldFunctionOnValues | lambda, |
const std::string | field_name_x, | ||
const std::string | field_name_y, | ||
bool | error_if_missing = false , |
||
Range * | ents_ptr = nullptr |
||
) |
filed lambda
Do calculation on two fields and save result to field fy input function usees field values
function | f(double &x, double) |
field_name_x | name of field_x |
field_name_y | name of field_y |
error_if_missing | throw error if missing entities of field y |
ents_ptr | execute lambda function only on entities given by pointer to range |
Definition at line 101 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::fieldScale | ( | const double | alpha, |
const std::string | field_name, | ||
Range * | ents_ptr = nullptr |
||
) |
field scale
scale | field by value |
field_name | name of field |
error_if_missing | throw error if missing entities of field y |
ents_ptr | execute lambda function only on entities given by pointer to range |
Definition at line 307 of file FieldBlas.cpp.
|
virtual |
Implements MoFEM::UnknownInterface.
Definition at line 10 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::setField | ( | const double | val, |
const EntityType | type, | ||
const Range & | ents, | ||
const std::string | field_name | ||
) |
set field
field_y = val
val | |
entity | type |
field_name |
Definition at line 407 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::setField | ( | const double | val, |
const EntityType | type, | ||
const std::string | field_name | ||
) |
val | is a set parameter \field_name is a field name |
Definition at line 386 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::setField | ( | const double | val, |
const std::string | field_name | ||
) |
set field
field_y = val
val | |
field_name |
Definition at line 441 of file FieldBlas.cpp.
MoFEMErrorCode MoFEM::FieldBlas::setVertexDofs | ( | FieldBlas::VertexCoordsFunction | lambda, |
const std::string | field_name, | ||
Range * | verts = nullptr |
||
) |
Set DOFs on vertices using user function.
lambda | function evaluating field at points |
field_name | is a field name |
verts | pointer to vertices if null all vertices in the field are evaluated) |
Definition at line 318 of file FieldBlas.cpp.
const MoFEM::Interface& MoFEM::FieldBlas::cOre |
Definition at line 26 of file FieldBlas.hpp.
bool MoFEM::FieldBlas::dEbug |
Definition at line 27 of file FieldBlas.hpp.