19 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.tpzbuildsbfem"));
26 int64_t nel = elindices.
size();
27 for (int64_t el=0; el<nel; el++) {
43 std::map<int64_t,int64_t> nodetogroup;
46 for (int64_t el=0; el<scalingcenters.
size(); el++) {
47 if (scalingcenters[el] == -1) {
50 if (nodetogroup.find(scalingcenters[el]) == nodetogroup.end()) {
51 nodetogroup[scalingcenters[el]] = count++;
63 for (std::map<int64_t,int64_t>::iterator it = nodetogroup.begin(); it != nodetogroup.end(); it++) {
67 for (int64_t el=0; el < nel; el++) {
69 if (gel->
Dimension() != dim && scalingcenters[el] != -1) {
76 if (scalingcenters[el] == -1) {
79 if (nodetogroup.find(scalingcenters[el]) == nodetogroup.end()) {
82 int64_t partition = nodetogroup[scalingcenters[el]];
102 int64_t nel = elindices.
size();
103 for (int64_t el=0; el<nel; el++) {
104 int64_t elindex = elindices[el];
116 std::set<int> matids;
120 for (int64_t el=0; el<nel; el++) {
142 std::set<int> matids;
146 for (int64_t el=0; el<nel; el++) {
184 for (int64_t el=0; el<nel; el++) {
197 int nsides = gel->
NSides();
198 for (
int is=0; is<nsides; is++) {
205 if (neighbour == thisside) {
208 int64_t neighbourelpartition = -1;
215 if(neighbour != thisside)
222 while (neighbour != thisside && neighbour.
Element()->
Dimension() != dim-1) {
226 if (thisside == neighbour && elpartition != neighbourelpartition) {
242 int64_t nel = elindices.
size();
245 for (int64_t el=0; el<elindices.
size(); el++) {
250 int nsides = gel->
NSides();
253 gel->
X(xicenter,xcenter);
272 std::set<int> matids, matidstarget;
274 int64_t mat = it->second;
276 matids.insert(it->first);
277 matidstarget.insert(it->second);
281 for (int64_t el=0; el<nel; el++) {
293 if (matids.find(gel->
MaterialId()) == matids.end()) {
296 int nsides = gel->
NSides();
297 for (
int is = 0; is<nsides; is++) {
303 int onlyinterpolated =
true;
304 int removeduplicates =
true;
309 for (
int icel=0; icel<ncelstack; icel++) {
319 for (
int in=0; in<nnodes; in++) {
323 for (
int in=nnodes; in < 2*nnodes; in++) {
340 std::cout <<
"Don't understand the number of nodes per side : nnodes " << nnodes << std::endl;
347 int64_t elementid = gmesh->
NElements()+1;
360 std::cout <<
"Don't understand the number of nodes per side : nnodes " << nnodes << std::endl;
372 cmesh.
ApproxSpace().SetAllCreateFunctionsSBFem(dim);
383 std::set<int> matids, matidstarget;
385 int64_t mat = it->second;
387 matids.insert(it->first);
388 matidstarget.insert(it->second);
392 for (int64_t el=0; el<nel; el++) {
406 if (matids.find(gel->
MaterialId()) == matids.end()) {
409 int nsides = gel->
NSides();
417 for (
int in=0; in<nnodes; in++) {
421 for (
int in=nnodes; in < 2*nnodes; in++) {
441 std::cout <<
"Don't understand the number of nodes per side : nnodes " << nnodes << std::endl;
448 int64_t elementid = gmesh->
NElements()+1;
461 std::cout <<
"Don't understand the number of nodes per side : nnodes " << nnodes << std::endl;
473 cmesh.
ApproxSpace().SetAllCreateFunctionsSBFem(dim);
484 std::set<int> matidsorig,matidstarget;
486 int64_t mat = it->second;
487 if(matids.find(mat) != matids.end())
489 matidsorig.insert(it->first);
493 for (int64_t el=0; el<nel; el++) {
501 if (matidsorig.find(gel->
MaterialId()) == matidsorig.end()) {
504 int nsides = gel->
NSides();
506 for (
int is = 0; is<nsides; is++) {
513 int onlyinterpolated =
true;
514 int removeduplicates =
true;
517 for (
int icel=0; icel<ncelstack; icel++) {
520 if (subgelside.
Dimension() != geldim-1) {
530 for (
int in=0; in<nnodes; in++) {
534 for (
int in=nnodes; in < nnodes*2; in++) {
560 if(logger->isDebugEnabled())
562 std::stringstream sout;
563 sout <<
"Created element of type " << targettype <<
" with nodes " << Nodes <<
" index " << index;
570 int64_t elementid = gmesh->
NElements()+1;
572 switch (targettype) {
590 if(logger->isDebugEnabled())
592 std::stringstream sout;
593 sout <<
"Created element of type " << targettype <<
" with nodes " << Nodes <<
" index " << index;
608 cmesh.
ApproxSpace().SetAllCreateFunctionsSBFem(dim);
618 int64_t groupelementindices(numgroups);
622 for (int64_t el=0; el<numgroups; el++) {
625 elementgroupindices[el] = index;
631 for (int64_t el=0; el<nel; el++) {
639 int64_t gelindex = gel->
Index();
669 while (neighbour != gelside) {
673 if (nsidenodesneighbour == nsidenodes)
676 for (
int i=0; i<nsidenodesneighbour; i++) {
680 for (
int i=0; i<nsidenodesneighbour; i++) {
681 if (neighnodes[i] == cornernodes[i]) {
685 if (numequal == nsidenodesneighbour) {
692 if (neighbour == gelside) {
700 if (gelgroup == -1) {
703 int64_t celgroupindex = elementgroupindices[gelgroup];
714 for (int64_t el=0; el<numgroups; el++) {
717 index = elementgroupindices[el];
725 for (int64_t is=0; is<
nsub; is++) {
741 for (
int ir=0; ir<nref; ir++)
745 for (int64_t el=0; el<nel; el++) {
757 for (
int isub=0; isub<
nsub; isub++) {
770 std::set<int> exclude;
772 if(volmatids.find(it->second) != volmatids.end())
774 exclude.insert(it->first);
778 for (
int ir=0; ir<nref; ir++)
782 for (int64_t el=0; el<nel; el++) {
789 if (exclude.find(matid) != exclude.end()) {
803 for (
int isub=0; isub<
nsub; isub++) {
virtual int64_t SideNodeIndex(int side, int nodenum) const =0
Returns the index of the nodenum node of side.
void CreateElementCenterNodes(TPZVec< int64_t > &elindices)
create a geometric node at the center of each partition
int64_t NElements() const
Number of computational elements allocated.
void EqualorHigherCompElementList2(TPZStack< TPZCompElSide > &celside, int onlyinterpolated, int removeduplicates)
Will return all elements of equal or higher level than than the current element.
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index) override
Creates a geometric element according to the type of the father element.
int AllocateNewElement()
Makes more room for new elements.
TPZStack< TPZCompEl *, 5 > GetElGroup()
int MaterialId() const
Returns the material index of the element.
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &cornerindexes, int matid, int64_t &index, int reftype=1)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
virtual void resize(const int64_t newsize)
clarg::argInt nsub("-nsub", "number of substructs", 4)
Contains declaration of TPZCompEl class which defines the interface of a computational element...
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
void DivideSkeleton(int nref)
Divide the skeleton elements.
int64_t NElements() const
Number of elements of the mesh.
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
std::map< int, int > fMatIdTranslation
The volumetric elements with Mat Id will spawn SBFemVolume elements with MatId.
int64_t NElements() const
Access method to query the number of elements of the vector.
Implements a chunk vector with free store administration. Utility.
TPZGeoElSide Neighbour() const
void CreateVolumetricElements(TPZCompMesh &cmesh)
create geometric volumetric elements
virtual int NSides() const =0
Returns the number of connectivities of the element.
virtual void Divide(TPZVec< TPZGeoEl *> &pv)
Divides the element and puts the resulting elements in the vector.
virtual int64_t NodeIndex(int i) const =0
Returns the index of the ith node the index is the location of the node in the nodevector of the mesh...
virtual int SideDimension(int side) const =0
Return the dimension of side.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
void LoadReferences()
Map this grid in the geometric grid.
void BuildComputationalMeshFromSkeleton(TPZCompMesh &cmesh)
build the computational elements of the skeleton and build the volume elements directly from the skel...
virtual void CenterPoint(int side, TPZVec< REAL > &masscent) const =0
It returns the coordinates from the center of the side of the element in the element coordinate space...
bool IsLinearMapping() const
int64_t size() const
Returns the number of elements of the vector.
TPZCompEl * Element(int64_t iel)
TPZCreateApproximationSpace & ApproxSpace()
void AddSkeletonElements()
create the geometric skeleton elements
Implements a generic geometric element which is refined according to a generic refinement pattern...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
void CreateVolumetricElementsFromSkeleton(TPZCompMesh &cmesh)
create geometric volumetric elements
Contains the TPZGeoBlend class which implements a blending map from curved boundaries to the interior...
TPZGeoEl * Element(int64_t iel)
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
#define DebugStop()
Returns a message to user put a breakpoint in.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
int Dimension() const
Returns the dimension of the simulation.
virtual void AddElement(TPZCompEl *cel)
add an element to the element group
virtual MElementType Type() const =0
Returns the element type acording to pzeltype.h.
TPZMaterial * FindMaterial(int id)
Find the material with identity id.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
TPZCompEl * Reference() const
Return a pointer to the element referenced by the geometric element.
virtual void AutoBuild(const std::set< int > *MaterialIDs)
Creates the computational elements, and the degree of freedom nodes.
int fSkeletonMatId
Material Id associated with the skeleton elements.
virtual TPZGeoEl * CreateBCGeoEl(int side, int bc)=0
Method which creates a geometric element on the side of an existing element.
Contains declaration of TPZGeoElRefPattern class which implements a generic geometric element which i...
void SetAllCreateFunctionsContinuous()
Create continuous approximation spaces.
void BuildComputationMesh(TPZCompMesh &cmesh)
add the sbfem elements to the computational mesh, the material should exist in cmesh ...
int64_t Index() const
Returns element index of the mesh fELementVec list.
static int nsidenodes[27]
Vector with the number of vertices contained in the closure of the side.
virtual int NSideNodes(int side) const =0
Returns the number of nodes for a particular side.
virtual int HasSubElement() const =0
Return 1 if the element has subelements.
TPZGeoEl * Element() const
void BuildConnectivity()
Build the connectivity of the grid.
TPZManVector< int64_t > fElementPartition
partition to which each element belongs
virtual int Dimension() const =0
Returns the dimension of the element.
void SetSkeleton(int64_t skeleton)
Data structure initialization.
int Dimension()
Get Dimension.
void StandardConfiguration()
standard configuration means each element is a partition and a center node is created ...
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
virtual void X(TPZVec< REAL > &qsi, TPZVec< REAL > &result) const =0
Return the coordinate in real space of the point coordinate in the master element space...
This class implements a geometric mesh for the pz environment. Geometry.
MElementType
Define the element types.
int Dimension() const
the dimension associated with the element/side
Implements computational mesh. Computational Mesh.
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
int64_t NElements() const
Returns the number of elements of the vector.
void SetElementGroupIndex(int64_t index)
Initialize the data structure indicating the group index.
void ResetReference()
Resets all load references in elements and nodes.
Defines the interface of a computational element. Computational Element.
void Configure(TPZVec< int64_t > &scalingcenters)
build element groups according to the id of the scaling centers
int64_t SideNodeIndex(int nodenum) const
Returns the index of the nodenum node of side.
TPZAutoPointer< TPZGeoMesh > fGMesh
geometric mesh
TPZManVector< int64_t > fPartitionCenterNode
center node id for each partition
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.