NeoPZ
TPZWavyLine.cpp
Go to the documentation of this file.
1 //
2 // TPZWavyLine.cpp
3 // PZ
4 //
5 // Created by Philippe Devloo on 3/21/14.
6 //
7 //
8 
9 #include "TPZWavyLine.h"
10 #include "tpzgeomid.h"
11 #include "tpzgeoelmapped.h"
12 #include "tpzgeoelrefpattern.h"
13 
14 namespace pzgeom {
15 
16 // TPZGeoEl *TPZWavyLine::CreateBCGeoEl(TPZGeoEl *orig, int side,int bc)
17 // {
18 
19 // int ns = orig->NSideNodes(side);
20 // TPZManVector<int64_t> nodeindices(ns);
21 // int in;
22 // for(in=0; in<ns; in++)
23 // {
24 // nodeindices[in] = orig->SideNodeIndex(side,in);
25 // }
26 // int64_t index;
27 
28 // TPZGeoMesh *mesh = orig->Mesh();
29 // MElementType type = orig->Type(side);
30 
31 // TPZGeoEl *newel = mesh->CreateGeoBlendElement(type, nodeindices, bc, index);
32 // TPZGeoElSide me(orig,side);
33 // TPZGeoElSide newelside(newel,newel->NSides()-1);
34 
35 // newelside.InsertConnectivity(me);
36 // newel->Initialize();
37 
38 // return newel;
39 // }
40 
41 // /**
42 // * Creates a geometric element according to the type of the father element
43 // */
44 // /** @brief Creates a geometric element according to the type of the father element */
45 // TPZGeoEl *TPZWavyLine::CreateGeoElement(TPZGeoMesh &mesh, MElementType type,
46 // TPZVec<int64_t>& nodeindexes,
47 // int matid,
48 // int64_t& index)
49 
50 // {
51 // return CreateGeoElementMapped(mesh,type,nodeindexes,matid,index);
52 // }
53 
54 
55  int TPZWavyLine::ClassId() const{
56  return Hash("TPZWavyLine") ^ TPZGeoLinear::ClassId() << 1;
57  }
58 
59  void TPZWavyLine::InsertExampleElement(TPZGeoMesh &gmesh, int matid, TPZVec<REAL> &lowercorner, TPZVec<REAL> &size)
60  {
61  TPZManVector<REAL,3> x0(lowercorner), x1(lowercorner), wavedir(3,0.);
62  x1[0] = x0[0]+2.;
63  wavedir[1] = 1.;
64  int numwaves = 4;
66  nodind[0] = gmesh.NodeVec().AllocateNewElement();
67  gmesh.NodeVec()[nodind[0]].Initialize(x0, gmesh);
68  nodind[1] = gmesh.NodeVec().AllocateNewElement();
69  gmesh.NodeVec()[nodind[1]].Initialize(x1, gmesh);
70 
72  size[0] = 2.;
73  size[1] = 2.;
74  gel->Geom().SetData(wavedir, numwaves);
75 
76  }
77 
78 }
79 
80 
81 
83 
85 
int AllocateNewElement()
Makes more room for new elements.
Definition: pzadmchunk.h:184
static void InsertExampleElement(TPZGeoMesh &gmesh, int matid, TPZVec< REAL > &lowercorner, TPZVec< REAL > &size)
Definition: TPZWavyLine.cpp:59
int ClassId() const override
Creates a geometric element according to the type of the father element.
Definition: TPZWavyLine.cpp:55
Implements the mapping between the master element and deformed element. Geometry. ...
Contains declaration of TPZGeoElMapped class which implements a geometric element using its ancestral...
int ClassId() const override
Method which creates a geometric boundary condition element based on the current geometric element...
Implements a generic geometric element which is refined according to a generic refinement pattern...
Definition: pzgmesh.h:35
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
Definition: pzgmesh.h:140
Contains declaration of TPZGeoElRefPattern class which implements a generic geometric element which i...
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
Groups all classes which model the geometry.
Definition: pzgeopoint.cpp:18
static int nodind[7][8]
Implements an interface to register a class id and a restore function. Persistence.
Definition: TPZSavable.h:150