v0.14.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
MoFEM::OpPostProcMapInMoab< DIM1, DIM2 > Struct Template Reference

Post post-proc data at points from hash maps. More...

#include <src/post_proc/PostProcBrokenMeshInMoabBase.hpp>

Inheritance diagram for MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >:
[legend]
Collaboration diagram for MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >:
[legend]

Public Types

using DataMapVec = std::map< std::string, boost::shared_ptr< VectorDouble > >
 
using DataMapMat = std::map< std::string, boost::shared_ptr< MatrixDouble > >
 
- 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...
 
using AdjCache = std::map< EntityHandle, std::vector< boost::weak_ptr< NumeredEntFiniteElement > > >
 
- 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 Member Functions

 OpPostProcMapInMoab (moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, DataMapVec data_map_scalar, DataMapMat data_map_vec, DataMapMat data_map_mat, DataMapMat data_symm_map_mat)
 Construct a new OpPostProcMapInMoab object. More...
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
- 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, AdjCache *adj_cache=nullptr)
 User calls this function to loop over elements on the side of face. This function calls finite element with its operator to do calculations. More...
 
MoFEMErrorCode loopThis (const string &fe_name, ForcesAndSourcesCore *this_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over the same element using a different set of integration points. This function calls finite element with its 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 calls this function to loop over parent elements. This function calls finite element with its 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 calls this function to loop over parent elements. This function calls finite element with its 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 Attributes

moab::Interface & postProcMesh
 
std::vector< EntityHandle > & mapGaussPts
 
DataMapVec dataMapScalar
 
DataMapMat dataMapVec
 
DataMapMat dataMapMat
 
DataMapMat dataMapSymmMat
 

Additional Inherited Members

- 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 []
 
- Protected Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
virtual MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

template<int DIM1, int DIM2>
struct MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >

Post post-proc data at points from hash maps.

Template Parameters
DIM1dimension of vector in data_map_vec and first column of data_map_may
DIM2dimension of second column in data_map_mat
Examples
adolc_plasticity.cpp, approx_sphere.cpp, dynamic_first_order_con_law.cpp, eigen_elastic.cpp, elasticity_mixed_formulation.cpp, free_surface.cpp, heat_equation.cpp, heat_method.cpp, helmholtz.cpp, level_set.cpp, mixed_poisson.cpp, navier_stokes.cpp, nonlinear_elastic.cpp, operators_tests.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, reaction_diffusion.cpp, scalar_check_approximation.cpp, seepage.cpp, shallow_wave.cpp, simple_elasticity.cpp, tensor_divergence_operator.cpp, thermo_elastic.cpp, and wave_equation.cpp.

Definition at line 698 of file PostProcBrokenMeshInMoabBase.hpp.

Member Typedef Documentation

◆ DataMapMat

template<int DIM1, int DIM2>
using MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::DataMapMat = std::map<std::string, boost::shared_ptr<MatrixDouble> >

Definition at line 701 of file PostProcBrokenMeshInMoabBase.hpp.

◆ DataMapVec

template<int DIM1, int DIM2>
using MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::DataMapVec = std::map<std::string, boost::shared_ptr<VectorDouble> >

Definition at line 700 of file PostProcBrokenMeshInMoabBase.hpp.

Constructor & Destructor Documentation

◆ OpPostProcMapInMoab()

template<int DIM1, int DIM2>
MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::OpPostProcMapInMoab ( moab::Interface &  post_proc_mesh,
std::vector< EntityHandle > &  map_gauss_pts,
DataMapVec  data_map_scalar,
DataMapMat  data_map_vec,
DataMapMat  data_map_mat,
DataMapMat  data_symm_map_mat 
)
inline

Construct a new OpPostProcMapInMoab object.

Parameters
post_proc_meshpostprocessing mesh
map_gauss_ptsmap of gauss points to nodes of postprocessing mesh
data_map_scalarhash map of scalar values (string is name of the tag)
data_map_vechash map of vector values
data_map_mathash map of second order tensor values
data_symm_map_mathash map of symmetric second order tensor values

Definition at line 714 of file PostProcBrokenMeshInMoabBase.hpp.

718 : ForcesAndSourcesCore::UserDataOperator(
719 NOSPACE, ForcesAndSourcesCore::UserDataOperator::OPSPACE),
720 postProcMesh(post_proc_mesh), mapGaussPts(map_gauss_pts),
721 dataMapScalar(data_map_scalar), dataMapVec(data_map_vec),
722 dataMapMat(data_map_mat), dataMapSymmMat(data_symm_map_mat) {
723 // Operator is only executed for vertices
724 std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
725 }
@ NOSPACE
Definition: definitions.h:83
std::array< bool, MBMAXTYPE > doEntities
If true operator is executed for entity.
DataMapMat dataMapMat
DataMapMat dataMapVec
DataMapMat dataMapSymmMat
moab::Interface & postProcMesh
std::vector< EntityHandle > & mapGaussPts
DataMapVec dataMapScalar

Member Function Documentation

◆ doWork()

template<int DIM1, int DIM2>
MoFEMErrorCode MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)
virtual

Operator for linear form, usually to calculate values on right hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 740 of file PostProcBrokenMeshInMoabBase.hpp.

741 {
743
744 std::array<double, 9> def;
745 std::fill(def.begin(), def.end(), 0);
746
747 auto get_tag = [&](const std::string name, size_t size) {
748 Tag th;
749 CHKERR postProcMesh.tag_get_handle(name.c_str(), size, MB_TYPE_DOUBLE, th,
750 MB_TAG_CREAT | MB_TAG_SPARSE,
751 def.data());
752 return th;
753 };
754
755 MatrixDouble3by3 mat(3, 3);
756
757 auto set_vector_3d = [&](auto &t) -> MatrixDouble3by3 & {
758 mat.clear();
759 for (size_t r = 0; r != DIM1; ++r)
760 mat(0, r) = t(r);
761 return mat;
762 };
763
764 auto set_matrix_3d = [&](auto &t) -> MatrixDouble3by3 & {
765 mat.clear();
766 for (size_t r = 0; r != DIM1; ++r)
767 for (size_t c = 0; c != DIM2; ++c)
768 mat(r, c) = t(r, c);
769 return mat;
770 };
771
772 auto set_matrix_symm_3d = [&](auto &t) -> MatrixDouble3by3 & {
773 mat.clear();
774 for (size_t r = 0; r != DIM1; ++r)
775 for (size_t c = 0; c != DIM1; ++c)
776 mat(r, c) = t(r, c);
777 return mat;
778 };
779
780 auto set_scalar = [&](auto t) -> MatrixDouble3by3 & {
781 mat.clear();
782 mat(0, 0) = t;
783 return mat;
784 };
785
786 auto set_float_precision = [](const double x) {
787 if (std::abs(x) < std::numeric_limits<float>::epsilon())
788 return 0.;
789 else
790 return x;
791 };
792
793 auto set_tag = [&](auto th, auto gg, MatrixDouble3by3 &mat) {
794 for (auto &v : mat.data())
795 v = set_float_precision(v);
796 return postProcMesh.tag_set_data(th, &mapGaussPts[gg], 1,
797 &*mat.data().begin());
798 };
799
800 for (auto &m : dataMapScalar) {
801 if (m.second) {
802 auto th = get_tag(m.first, 1);
803 auto t_scl = getFTensor0FromVec(*m.second);
804 auto nb_integration_pts = getGaussPts().size2();
805 for (int gg = 0; gg != nb_integration_pts; ++gg) {
806 CHKERR set_tag(th, gg, set_scalar(t_scl));
807 ++t_scl;
808 }
809 }
810 }
811
812 for (auto &m : dataMapVec) {
813 if (m.second) {
814 auto th = get_tag(m.first, 3);
815 auto t_vec = getFTensor1FromMat<DIM1>(*m.second);
816 auto nb_integration_pts = getGaussPts().size2();
817 for (int gg = 0; gg != nb_integration_pts; ++gg) {
818 CHKERR set_tag(th, gg, set_vector_3d(t_vec));
819 ++t_vec;
820 }
821 }
822 }
823
824 for (auto &m : dataMapMat) {
825 if (m.second) {
826 auto th = get_tag(m.first, 9);
827 auto t_mat = getFTensor2FromMat<DIM1, DIM2>(*m.second);
828 auto nb_integration_pts = getGaussPts().size2();
829 for (int gg = 0; gg != nb_integration_pts; ++gg) {
830 CHKERR set_tag(th, gg, set_matrix_3d(t_mat));
831 ++t_mat;
832 }
833 }
834 }
835
836 for (auto &m : dataMapSymmMat) {
837 if (m.second) {
838 auto th = get_tag(m.first, 9);
839 auto t_mat = getFTensor2SymmetricFromMat<DIM1>(*m.second);
840 auto nb_integration_pts = getGaussPts().size2();
841 for (int gg = 0; gg != nb_integration_pts; ++gg) {
842 CHKERR set_tag(th, gg, set_matrix_symm_3d(t_mat));
843 ++t_mat;
844 }
845 }
846 }
847
849}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'm', SPACE_DIM > m
const double c
speed of light (cm/ns)
const double v
phase velocity of light in medium (cm/ns)
constexpr int DIM2
Definition: level_set.cpp:22
constexpr int DIM1
Definition: level_set.cpp:21
MatrixBoundedArray< double, 9 > MatrixDouble3by3
Definition: Types.hpp:105
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
int r
Definition: sdf.py:8
constexpr double t
plate stiffness
Definition: plate.cpp:59
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element

Member Data Documentation

◆ dataMapMat

template<int DIM1, int DIM2>
DataMapMat MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::dataMapMat
private

Definition at line 734 of file PostProcBrokenMeshInMoabBase.hpp.

◆ dataMapScalar

template<int DIM1, int DIM2>
DataMapVec MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::dataMapScalar
private

Definition at line 732 of file PostProcBrokenMeshInMoabBase.hpp.

◆ dataMapSymmMat

template<int DIM1, int DIM2>
DataMapMat MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::dataMapSymmMat
private

Definition at line 735 of file PostProcBrokenMeshInMoabBase.hpp.

◆ dataMapVec

template<int DIM1, int DIM2>
DataMapMat MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::dataMapVec
private

Definition at line 733 of file PostProcBrokenMeshInMoabBase.hpp.

◆ mapGaussPts

template<int DIM1, int DIM2>
std::vector<EntityHandle>& MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::mapGaussPts
private

Definition at line 731 of file PostProcBrokenMeshInMoabBase.hpp.

◆ postProcMesh

template<int DIM1, int DIM2>
moab::Interface& MoFEM::OpPostProcMapInMoab< DIM1, DIM2 >::postProcMesh
private

Definition at line 730 of file PostProcBrokenMeshInMoabBase.hpp.


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