NeoPZ
TPZBuildSBFem.h
Go to the documentation of this file.
1 //
2 // TPZBuildSBFem.hpp
3 // PZ
4 //
5 // Created by Philippe Devloo on 06/01/17.
6 //
7 //
8 
9 #ifndef TPZBuildSBFem_hpp
10 #define TPZBuildSBFem_hpp
11 
12 #include <stdio.h>
13 #include "pzmanvector.h"
14 #include "pzgmesh.h"
15 #include "pzcmesh.h"
16 #include "tpzautopointer.h"
17 #include <map>
18 
20 {
23 
25  std::map<int,int> fMatIdTranslation;
26 
29 
32 
35 
36 public:
37 
39  TPZBuildSBFem(TPZAutoPointer<TPZGeoMesh> gmesh, int skeletonmatid, std::map<int,int> &matidtranslation) : fGMesh(gmesh), fMatIdTranslation(matidtranslation), fSkeletonMatId(skeletonmatid)
40  {
41  fElementPartition.resize(fGMesh->NElements());
42  fElementPartition.Fill(-1);
43  }
44 
46  void SetMatIdTranslation(const std::map<int,int> &matidtranslation)
47  {
48  fMatIdTranslation = matidtranslation;
49  }
50 
52  void StandardConfiguration();
53 
55  void StandardConfiguration(TPZVec<int64_t> &elementindices);
56 
58  void Configure(TPZVec<int64_t> &scalingcenters);
59 
61  void AddPartition(TPZVec<int64_t> &elids, int64_t centernodeindex);
62 
64  void SetPartitions(TPZVec<int64_t> &gelpartitionids, TPZVec<int64_t> &partition_nodeindices)
65  {
66 #ifdef PZDEBUG
67  if(gelpartitionids.size() != fGMesh->NElements())
68  {
69  DebugStop();
70  }
71 #endif
72  fElementPartition = gelpartitionids;
73  fPartitionCenterNode = partition_nodeindices;
74  }
75 
77  void BuildComputationMesh(TPZCompMesh &cmesh);
78 
80  void BuildComputationMesh(TPZCompMesh &cmesh, const std::set<int> &volmatids, const std::set<int> &boundmatids);
81 
84 
86  void DivideSkeleton(int nref);
87 
89  void DivideSkeleton(int nref, const std::set<int> &volmatids);
90 
91 private:
93  void AddSkeletonElements();
94 
97 
100 
103 
105  void CreateVolumetricElements(TPZCompMesh &cmesh, const std::set<int> &matids);
106 
108  void CreateElementGroups(TPZCompMesh &cmesh);
109 };
110 
111 #endif /* TPZBuildSBFem_hpp */
void CreateElementCenterNodes(TPZVec< int64_t > &elindices)
create a geometric node at the center of each partition
void SetPartitions(TPZVec< int64_t > &gelpartitionids, TPZVec< int64_t > &partition_nodeindices)
define the partition index of each element and the ids of the scaling centers
Definition: TPZBuildSBFem.h:64
virtual void resize(const int64_t newsize)
Definition: pzvec.h:213
void DivideSkeleton(int nref)
Divide the skeleton elements.
int64_t NElements() const
Number of elements of the mesh.
Definition: pzgmesh.h:129
std::map< int, int > fMatIdTranslation
The volumetric elements with Mat Id will spawn SBFemVolume elements with MatId.
Definition: TPZBuildSBFem.h:25
void CreateVolumetricElements(TPZCompMesh &cmesh)
create geometric volumetric elements
void BuildComputationalMeshFromSkeleton(TPZCompMesh &cmesh)
build the computational elements of the skeleton and build the volume elements directly from the skel...
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
void AddSkeletonElements()
create the geometric skeleton elements
void CreateVolumetricElementsFromSkeleton(TPZCompMesh &cmesh)
create geometric volumetric elements
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
Free store vector implementation.
int fSkeletonMatId
Material Id associated with the skeleton elements.
Definition: TPZBuildSBFem.h:28
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
void BuildComputationMesh(TPZCompMesh &cmesh)
add the sbfem elements to the computational mesh, the material should exist in cmesh ...
Contains declaration of TPZCompMesh class which is a repository for computational elements...
void SetMatIdTranslation(const std::map< int, int > &matidtranslation)
set the matid translation
Definition: TPZBuildSBFem.h:46
TPZManVector< int64_t > fElementPartition
partition to which each element belongs
Definition: TPZBuildSBFem.h:31
TPZBuildSBFem(TPZAutoPointer< TPZGeoMesh > gmesh, int skeletonmatid, std::map< int, int > &matidtranslation)
simple constructor
Definition: TPZBuildSBFem.h:39
void StandardConfiguration()
standard configuration means each element is a partition and a center node is created ...
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
void AddPartition(TPZVec< int64_t > &elids, int64_t centernodeindex)
add a partition manually
void CreateElementGroups(TPZCompMesh &cmesh)
put the sbfem volumetric elements in element groups
void Fill(const T &copy, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
Definition: pzvec.h:460
void Configure(TPZVec< int64_t > &scalingcenters)
build element groups according to the id of the scaling centers
TPZAutoPointer< TPZGeoMesh > fGMesh
geometric mesh
Definition: TPZBuildSBFem.h:22
TPZManVector< int64_t > fPartitionCenterNode
center node id for each partition
Definition: TPZBuildSBFem.h:34