v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MoFEM::PostProcGenerateRefMesh< MBEDGE > Struct Reference

#include "src/post_proc/PostProcBrokenMeshInMoabBase.hpp"

Inheritance diagram for MoFEM::PostProcGenerateRefMesh< MBEDGE >:
[legend]
Collaboration diagram for MoFEM::PostProcGenerateRefMesh< MBEDGE >:
[legend]

Public Member Functions

MoFEMErrorCode generateReferenceElementMesh ()
 
 PostProcGenerateRefMeshBase ()
 
- Public Member Functions inherited from MoFEM::PostProcGenerateRefMeshBase
 PostProcGenerateRefMeshBase ()
 
virtual ~PostProcGenerateRefMeshBase ()=default
 
virtual MoFEMErrorCode getOptions (std::string prefix)
 

Additional Inherited Members

- Public Attributes inherited from MoFEM::PostProcGenerateRefMeshBase
std::vector< MatrixDoublelevelShapeFunctions
 
std::vector< MatrixDoublelevelGaussPtsOnRefMesh
 
std::vector< ublas::matrix< int > > levelRef
 
EntityHandle startingVertEleHandle
 
std::vector< double * > verticesOnEleArrays
 
EntityHandle startingEleHandle
 
EntityHandleeleConn
 
int countEle
 
int countVertEle
 
int nbVertices
 
int nbEles
 
PetscBool hoNodes
 
int defMaxLevel
 

Detailed Description

Definition at line 95 of file PostProcBrokenMeshInMoabBase.hpp.

Member Function Documentation

◆ generateReferenceElementMesh()

MoFEMErrorCode MoFEM::PostProcGenerateRefMesh< MBEDGE >::generateReferenceElementMesh ( )
virtual

Implements MoFEM::PostProcGenerateRefMeshBase.

Definition at line 640 of file PostProcBrokenMeshInMoabBase.cpp.

640 {
642
643#ifndef NDEBUG
644 if (defMaxLevel > 0)
645 MOFEM_LOG("WORLD", Sev::warning)
646 << "Refinement for edges is not implemented";
647#endif
648
649 auto set_gauss_pts = [&](std::map<EntityHandle, int> &little_map) {
651
652 int nb_nodes = 2;
653 if (hoNodes)
654 nb_nodes = 3;
655
656 auto &gauss_pts = levelGaussPtsOnRefMesh[0];
657 gauss_pts.resize(2, nb_nodes, false);
658 gauss_pts.clear();
659
660 int nn = 0;
661 for (; nn != 2; ++nn) {
662 gauss_pts(0, nn) = static_cast<double>(nn);
663 little_map[nn] = nn;
664 }
665
666 if (nn < nb_nodes) {
667 gauss_pts(0, nn) = 0.5;
668 little_map[nn] = 2;
669 }
670
672 };
673
674 auto set_ref_edges = [&](std::map<EntityHandle, int> &little_map) {
676
677 int level = 0;
678 int nb_edges = level + 1;
679
680 int nb_nodes = 2;
681 if (hoNodes)
682 nb_nodes = 3;
683
684 auto &ref_edges = levelRef[level];
685 ref_edges.resize(nb_edges, nb_nodes, false);
686
687 for (int ee = 0; ee != nb_edges; ++ee) {
688 int nn = 0;
689 for (; nn != 2; ++nn) {
690 ref_edges(ee, nn) = nb_nodes * ee + nn;
691 }
692 if (nn < nb_nodes) {
693 ref_edges(ee, nn) = nb_nodes * ee + 2;
694 }
695 }
696
698 };
699
700 auto set_shape_functions = [&]() {
702 auto &gauss_pts = levelGaussPtsOnRefMesh[0];
703 auto &shape_functions = levelShapeFunctions[0];
704 const auto nb_gauss_pts = gauss_pts.size2();
705 shape_functions.resize(nb_gauss_pts, 2);
706 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
707 const double ksi = gauss_pts(0, gg);
708 shape_functions(gg, 0) = N_MBEDGE0(ksi);
709 shape_functions(gg, 1) = N_MBEDGE1(ksi);
710 }
712 };
713
714 levelRef.resize(1);
715 levelGaussPtsOnRefMesh.resize(1);
716 levelShapeFunctions.resize(1);
717
718 std::map<EntityHandle, int> little_map;
719 CHKERR set_gauss_pts(little_map);
720 CHKERR set_ref_edges(little_map);
721 CHKERR set_shape_functions();
722
724}
#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.
#define N_MBEDGE0(x)
edge shape function
Definition fem_tools.h:105
#define N_MBEDGE1(x)
edge shape function
Definition fem_tools.h:106
#define MOFEM_LOG(channel, severity)
Log.
std::vector< ublas::matrix< int > > levelRef

◆ PostProcGenerateRefMeshBase()

MoFEM::PostProcGenerateRefMeshBase::PostProcGenerateRefMeshBase ( )

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