v0.16.3
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O > 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, O >:
[legend]
Collaboration diagram for MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >:
[legend]

Public Types

using ScalarDataPtr = std::variant< boost::shared_ptr< VectorDouble >, boost::shared_ptr< MatrixDouble > >
 
using DataMapVec = std::map< std::string, ScalarDataPtr >
 
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.
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side.
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPSPACE, const bool symm=true)
 Constructor for operators working on finite element spaces.
 
 UserDataOperator (const std::string field_name, const char type, const bool symm=true)
 Constructor for operators working on a single field.
 
 UserDataOperator (const std::string row_field_name, const std::string col_field_name, const char type, const bool symm=true)
 Constructor for operators working on two fields (bilinear forms)
 
boost::shared_ptr< const NumeredEntFiniteElement > getNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement.
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle.
 
int getFEDim () const
 Get dimension of finite element.
 
EntityType getFEType () const
 Get dimension of finite element.
 
boost::weak_ptr< SideNumber > getSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer.
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity.
 
int getNumberOfNodesOnElement () const
 Get the number of nodes on finite element.
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices.
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices.
 
const FEMethod * getFEMethod () const
 Return raw pointer to Finite Element Method object.
 
int getOpType () const
 Get operator types.
 
void setOpType (const OpType type)
 Set operator type.
 
void addOpType (const OpType type)
 Add operator type.
 
int getNinTheLoop () const
 get number of finite element in the loop
 
int getLoopSize () const
 get size of elements in the loop
 
std::string getFEName () const
 Get name of the element.
 
ForcesAndSourcesCore * getPtrFE () const
 
ForcesAndSourcesCore * getSidePtrFE () const
 
ForcesAndSourcesCore * getRefinePtrFE () const
 
const PetscData::Switches & getDataCtx () 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
 
MatrixDouble & getGaussPts ()
 matrix of integration (Gauss) points for Volume Element
 
auto getFTensor0IntegrationWeight ()
 Get integration weights.
 
MatrixDouble & getCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3)
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry.
 
double getMeasure () const
 get measure of element
 
double & getMeasure ()
 get measure of element
 
MoFEM::Interface & getMField ()
 
moab::Interface & getMoab ()
 
virtual boost::weak_ptr< ForcesAndSourcesCore > getSubPipelinePtr () const
 
MoFEMErrorCode loopSide (const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim, const EntityHandle ent_for_side=0, boost::shared_ptr< Range > fe_range=nullptr, 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.
 
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.
 
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.
 
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.
 
MoFEMErrorCode loopRange (const string &fe_name, ForcesAndSourcesCore *range_fe, boost::shared_ptr< Range > fe_range, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 Iterate over range of elements.
 
- 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.
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &data, const bool error_if_no_base=false)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not.
 
void setSymm ()
 set if operator is executed taking in account symmetry
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem
 

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.
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity.
 
bool & doVertices
 \deprectaed If false skip vertices
 
bool & doEdges
 \deprectaed If false skip edges
 
bool & doQuads
 \deprectaed
 
bool & doTris
 \deprectaed
 
bool & doTets
 \deprectaed
 
bool & doPrisms
 \deprectaed
 
- 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
ForcesAndSourcesCore * ptrFE
 

Detailed Description

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
struct MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >

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
/home/lk58p/mofem_install/vanilla_dev_release/mofem-cephas/mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianPlasticity.cpp, cell_forces.cpp, mofem/atom_tests/operators_tests.cpp, mofem/atom_tests/scalar_check_approximation.cpp, mofem/atom_tests/tensor_divergence_operator.cpp, mofem/atom_tests/test_broken_space.cpp, mofem/tools/mesh_smoothing.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-3_level_set/level_set.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-5_poroelasticity/seepage.cpp, mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp, mofem/tutorials/clx-0_acoustics/helmholtz.cpp, mofem/tutorials/cor-10_navier_stokes/navier_stokes.cpp, mofem/tutorials/cor-2to5_analytical_poisson/src/PoissonOperators.hpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, mofem/tutorials/cor-7_elasticity_mixed_formulation/elasticity_mixed_formulation.cpp, mofem/tutorials/cor-9_reaction_diffusion/reaction_diffusion.cpp, mofem/tutorials/fun-2_plot_base/plot_base.cpp, mofem/tutorials/mix-0_mixed_poisson/mixed_poisson.cpp, mofem/tutorials/mix-1_light_intensity_equation/phase.cpp, mofem/tutorials/scl-0_least_squares/approximation.cpp, mofem/tutorials/scl-1_poisson_2d_homogeneous/poisson_2d_homogeneous.cpp, mofem/tutorials/scl-6_heat_equation/heat_equation.cpp, mofem/tutorials/scl-7_wave_equation/wave_equation.cpp, mofem/tutorials/scl-8_heat_radiation/radiation.cpp, mofem/tutorials/scl-9_heat_method/heat_method.cpp, mofem/tutorials/vec-1_eigen_elasticity/eigen_elastic.cpp, mofem/tutorials/vec-3_nonlinear_dynamics/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4_shallow_wave/approx_sphere.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, mofem/tutorials/vec-5_free_surface/free_surface.cpp, mofem/tutorials/vec-6_dg_kirchhoff_plate/plate.cpp, mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp, mofem/users_modules/adolc-plasticity/adolc_plasticity.cpp, mofem/users_modules/basic_finite_elements/elasticity/elasticity.cpp, mofem/users_modules/basic_finite_elements/nonlinear_elasticity/nonlinear_dynamics.cpp, nonlinear_elastic.cpp, plastic.cpp, thermo_elastic.cpp, and thermoplastic.cpp.

Definition at line 711 of file PostProcBrokenMeshInMoabBase.hpp.

Member Typedef Documentation

◆ DataMapMat

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

Definition at line 717 of file PostProcBrokenMeshInMoabBase.hpp.

◆ DataMapVec

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
using MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::DataMapVec = std::map<std::string, ScalarDataPtr>

Definition at line 716 of file PostProcBrokenMeshInMoabBase.hpp.

◆ ScalarDataPtr

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
using MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::ScalarDataPtr = std::variant<boost::shared_ptr<VectorDouble>, boost::shared_ptr<MatrixDouble> >

Definition at line 713 of file PostProcBrokenMeshInMoabBase.hpp.

Constructor & Destructor Documentation

◆ OpPostProcMapInMoab()

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::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 730 of file PostProcBrokenMeshInMoabBase.hpp.

734 : O(NOSPACE, O::OPSPACE), postProcMesh(post_proc_mesh),
735 mapGaussPts(map_gauss_pts), dataMapScalar(data_map_scalar),
736 dataMapVec(data_map_vec), dataMapMat(data_map_mat),
737 dataMapSymmMat(data_symm_map_mat) {
738 // Operator is only executed for vertices
739 std::fill(&O::doEntities[MBEDGE], &O::doEntities[MBMAXTYPE], false);
740 }
@ NOSPACE
Definition definitions.h:83
std::vector< EntityHandle > & mapGaussPts

Member Function Documentation

◆ doWork()

template<int DIM1, int DIM2, typename O >
MoFEMErrorCode MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::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 755 of file PostProcBrokenMeshInMoabBase.hpp.

756 {
758
759 std::array<double, 9> def;
760 std::fill(def.begin(), def.end(), 0);
761
762 auto get_tag = [&](const std::string name, size_t size) {
763 Tag th;
764 CHKERR postProcMesh.tag_get_handle(name.c_str(), size, MB_TYPE_DOUBLE, th,
765 MB_TAG_CREAT | MB_TAG_SPARSE,
766 def.data());
767 return th;
768 };
769
770 MatrixDouble3by3 mat(3, 3);
771
772 auto set_vector_3d = [&](auto &t) -> MatrixDouble3by3 & {
773 mat.clear();
774 for (size_t r = 0; r != DIM1; ++r)
775 mat(0, r) = t(r);
776 return mat;
777 };
778
779 auto set_matrix_3d = [&](auto &t) -> MatrixDouble3by3 & {
780 mat.clear();
781 for (size_t r = 0; r != DIM1; ++r)
782 for (size_t c = 0; c != DIM2; ++c)
783 mat(r, c) = t(r, c);
784 return mat;
785 };
786
787 auto set_matrix_symm_3d = [&](auto &t) -> MatrixDouble3by3 & {
788 mat.clear();
789 for (size_t r = 0; r != DIM1; ++r)
790 for (size_t c = 0; c != DIM1; ++c)
791 mat(r, c) = t(r, c);
792 return mat;
793 };
794
795 auto set_scalar = [&](auto t) -> MatrixDouble3by3 & {
796 mat.clear();
797 mat(0, 0) = t;
798 return mat;
799 };
800
801 auto set_float_precision = [](const double x) {
802 if (std::abs(x) < std::numeric_limits<float>::min())
803 return static_cast<float>(0.);
804 else
805 return static_cast<float>(x);
806 };
807
808 auto set_float_max = [](const double x) {
809 if (x > std::numeric_limits<float>::max())
810 return std::numeric_limits<float>::max();
811 else
812 return static_cast<float>(x);
813 };
814
815 auto set_float_lowest = [](const double x) {
816 if (x < std::numeric_limits<float>::lowest())
817 return std::numeric_limits<float>::lowest();
818 else
819 return static_cast<float>(x);
820 };
821
822 auto set_tag = [&](auto th, auto gg, MatrixDouble3by3 &mat) {
823 for (auto &v : mat.data())
824 v = set_float_max(set_float_lowest(set_float_precision(v)));
825 return postProcMesh.tag_set_data(th, &mapGaussPts[gg], 1,
826 &*mat.data().begin());
827 };
828
829 for (auto &m : dataMapScalar) {
830 if (const auto *vec_ptr =
831 std::get_if<boost::shared_ptr<VectorDouble>>(&m.second);
832 vec_ptr && *vec_ptr) {
833 auto th = get_tag(m.first, 1);
834 auto t_scl = getFTensor0FromVec(**vec_ptr);
835 auto nb_integration_pts = O::getGaussPts().size2();
836 for (int gg = 0; gg != nb_integration_pts; ++gg) {
837 CHKERR set_tag(th, gg, set_scalar(t_scl));
838 ++t_scl;
839 }
840 } else if (const auto *mat_ptr =
841 std::get_if<boost::shared_ptr<MatrixDouble>>(&m.second);
842 mat_ptr && *mat_ptr) {
843 auto th = get_tag(m.first, 1);
844 auto nb_integration_pts = O::getGaussPts().size2();
845 for (int gg = 0; gg != nb_integration_pts; ++gg)
846 CHKERR set_tag(th, gg, set_scalar((**mat_ptr)(0, gg)));
847 }
848 }
849
850 for (auto &m : dataMapVec) {
851 if (m.second) {
852 auto th = get_tag(m.first, 3);
853 auto nb_integration_pts = O::getGaussPts().size2();
854 auto t_vec = getFTensor1FromMat<DIM1>(m.second);
855 for (int gg = 0; gg != nb_integration_pts; ++gg) {
856 CHKERR set_tag(th, gg, set_vector_3d(t_vec));
857 ++t_vec;
858 }
859 }
860 }
861
862 for (auto &m : dataMapMat) {
863 if (m.second) {
864 auto th = get_tag(m.first, 9);
865 auto nb_integration_pts = O::getGaussPts().size2();
866 auto t_mat = getFTensor2FromMat<DIM1, DIM2>(m.second);
867 for (int gg = 0; gg != nb_integration_pts; ++gg) {
868 CHKERR set_tag(th, gg, set_matrix_3d(t_mat));
869 ++t_mat;
870 }
871 }
872 }
873
874 for (auto &m : dataMapSymmMat) {
875 if (m.second) {
876 auto th = get_tag(m.first, 9);
877 auto nb_integration_pts = O::getGaussPts().size2();
878 auto t_mat = getFTensor2SymmetricFromMat<DIM1>(m.second);
879 for (int gg = 0; gg != nb_integration_pts; ++gg) {
880 CHKERR set_tag(th, gg, set_matrix_symm_3d(t_mat));
881 ++t_mat;
882 }
883 }
884 }
885
887}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
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(V &data)
Get tensor rank 0 (scalar) form data vector.
int r
Definition sdf.py:205
constexpr double t
plate stiffness
Definition plate.cpp:58
FTensor::Index< 'm', 3 > m

Member Data Documentation

◆ dataMapMat

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
DataMapMat MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::dataMapMat
private

Definition at line 749 of file PostProcBrokenMeshInMoabBase.hpp.

◆ dataMapScalar

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
DataMapVec MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::dataMapScalar
private

Definition at line 747 of file PostProcBrokenMeshInMoabBase.hpp.

◆ dataMapSymmMat

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
DataMapMat MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::dataMapSymmMat
private

Definition at line 750 of file PostProcBrokenMeshInMoabBase.hpp.

◆ dataMapVec

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
DataMapMat MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::dataMapVec
private

Definition at line 748 of file PostProcBrokenMeshInMoabBase.hpp.

◆ mapGaussPts

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
std::vector<EntityHandle>& MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::mapGaussPts
private

Definition at line 746 of file PostProcBrokenMeshInMoabBase.hpp.

◆ postProcMesh

template<int DIM1, int DIM2, typename O = ForcesAndSourcesCore::UserDataOperator>
moab::Interface& MoFEM::OpPostProcMapInMoab< DIM1, DIM2, O >::postProcMesh
private

Definition at line 745 of file PostProcBrokenMeshInMoabBase.hpp.


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