25 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.tpzbuildmultiphysicsmesh"));
45 int64_t nmesh = cmeshVec.
size();
47 for(imesh = 0; imesh<nmesh; imesh++)
49 cmeshVec[imesh]->LoadReferences();
51 for(iel=0; iel<nMFEl; iel++)
98 for (int64_t el = 0; el < nMFEl; el++) {
110 int64_t nmeshes = cmeshVec.
size();
114 int64_t nconnects = 0;
116 for (imesh=0; imesh<nmeshes; imesh++)
118 FirstConnect[imesh] = nconnects;
119 nconnects += cmeshVec[imesh]->ConnectVec().
NElements();
125 for (imesh=0; imesh<nmeshes; imesh++)
128 int64_t nc = cmeshVec[imesh]->ConnectVec().
NElements();
129 for (ic=0; ic<nc; ic++)
131 TPZConnect &refcon = cmeshVec[imesh]->ConnectVec()[ic];
134 MFMesh->
ConnectVec()[counter].SetSequenceNumber(seqnum);
138 int ndof = refcon.
NDof(*cmeshVec[imesh]);
145 for (ic=0; ic<nc; ic++)
162 for (iel = 0; iel < nelem; iel++)
175 std::list<TPZOneShapeRestraint> oneshape;
176 for (imesh=0; imesh < nmeshes; imesh++) {
181 std::list<TPZOneShapeRestraint> celrest;
183 for (std::list<TPZOneShapeRestraint>::iterator it = celrest.begin(); it != celrest.end(); it++) {
186 for(
int face = 0; face < rest.
fFaces.
size(); face++)
188 int ic = rest.
fFaces[face].first;
189 convertedrest.
fFaces[face].first = ic+FirstConnect[imesh];
191 oneshape.push_back(convertedrest);
195 for (ic=0; ic<ncon; ic++) {
200 for (std::list<TPZOneShapeRestraint>::iterator it = oneshape.begin(); it != oneshape.end(); it++) {
213 int64_t nconnects_old = MFMesh->
NConnects();
214 int64_t nconnects = nconnects_old + cmesh->
NConnects();
219 int64_t counter = nconnects_old;
220 int64_t seqnum = nconnects_old;
224 for (ic=0; ic<nc; ic++)
230 MFMesh->
ConnectVec()[counter].SetSequenceNumber(seqnum);
234 int ndof = refcon.
NDof(*cmesh);
242 for (ic=0; ic<nc; ic++)
266 for (iel = 0; iel < nelem; iel++)
274 int64_t nfirstcon= 0;
278 for (imesh=0; imesh<nrefel; imesh++)
284 FirstConnect[imesh] = nfirstcon;
291 for (iel = 0; iel < nelem; iel++)
305 for (imesh=0; imesh < nmeshes; imesh++) {
312 for (ic=0; ic<ncon; ic++) {
326 int64_t nconnect = indexes.
size();
328 for(int64_t connect = 0; connect < nconnect; connect++)
331 if(!atomic_mesh)
continue;
336 int blsize = block.
Size(seqnum);
341 blockMF.
Put(seqnumMF,
idf, 0, block.
Get(seqnum,
idf, 0));
355 for(
int ic=0; ic<nconnect ; ic++){
365 int nblock = blockfather.
Size(seqnumfather);
373 int posfather = blockfather.
Position(seqnumfather);
374 STATE valsub = blocksub.
Get(seqnumsub,
idf,0);
390 for (int64_t el = 0; el<nel; el++) {
405 int64_t nconnect = indexes.
size();
407 for(int64_t connect = 0; connect < nconnect; connect++)
410 if(!atomic_mesh)
continue;
412 int64_t atomicindexconnect = indexes[connect].second;
416 int blsize = block.
Size(seqnum);
421 STATE
val = blockMF.
Get(seqnumMF,
idf, 0);
422 int64_t pos = block.
Position(seqnum);
428 for (int64_t el = 0; el<nel; el++) {
466 for (int64_t i=0; i<nelem; ++i) {
473 if(MaterialIDs.find(matid) == MaterialIDs.end())
478 int nsides = gel->
NSides();
480 for (is=0; is<nsides; ++is) {
482 if (sidedim != meshdim-1) {
505 if (equallevel.
size() > 1) {
517 int neighmat = allneigh[0].Element()->MaterialId();
518 if (MaterialIDs.find(neighmat) == MaterialIDs.end() ) {
532 std::set<int> lagrangematids;
533 lagrangematids.insert(LagrangeMat);
542 std::stringstream sout;
555 for (int64_t i=0; i<nelem; ++i) {
561 if(matid != LagrangeMat){
565 int nsides = gel->
NSides();
572 if (sidedim != meshdim-1) {
579 if(celsides.
size() < 1){
592 for (int64_t lp=0; lp<nelsides; ++lp) {
599 int matidright = gelright->MaterialId();
604 if(interfacematid == 0)
626 for(int64_t i=0; i<nel; i++){
633 if(mid==LagrangeMat){
637 for(
int i = 0; i<nsides; i++){
652 for(int64_t el=0; el < nel; el++){
654 if(!compEl)
continue;
664 for (
int iref = 0; iref < ndiv; iref++) {
667 for(int64_t el=0; el < nel; el++){
669 if(!compEl)
continue;
670 int ind = compEl->
Index();
672 compEl->
Divide(ind, subindex, 0);
685 for(int64_t i=0; i<ncon; i++)
692 for(int64_t i=0; i<nel; i++){
710 for(int64_t el=0; el < nel; el++){
712 if(!compEl)
continue;
713 int64_t ind = compEl->
Index();
725 int nneighs = neighequal.
size();
728 for(
int i =0; i<nneighs; i++)
732 indneigh = InterpEl->
Index();
733 InterpEl->
Divide(indneigh, subindexneigh, 1);
738 compEl->
Divide(indexEl, subindex, 1);
751 for(int64_t i=0; i<ncon; i++)
758 for(int64_t i=0; i<nel; i++){
778 scalnames.
Push(
"State");
782 int neq = equationindices.
size();
785 for (
int ieq = 0; ieq < neq; ieq++) {
786 analysis.
Solution()(equationindices[ieq],0) = 1.;
808 if (!hdivel || !cel || gel->
Dimension() != dimMesh) {
816 for (
int side = 0; side < gel->
NSides(); side++)
827 int sideorder = conside.
Order();
863 std::cout <<
"ElementType not found!";
897 ListGroupEl.push_back(wrapEl);
906 int nmeshes = mphys->
NMeshes();
907 for (
int imesh = 0; imesh<nmeshes; imesh++) {
913 for (
int ic=0; ic<nc; ic++) {
916 indexes[conindex] =
atomic_index(atomic_mesh,atomic_conindex);
926 for (
int el=0; el<elvec.
size(); el++) {
966 indexes.
Resize(ncon, def);
967 for (int64_t el = 0; el<nel; el++) {
int64_t NElements() const
Number of computational elements allocated.
void HigherLevelCompElementList2(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected computational elements which have level higher to the current element if onlyi...
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
void AdjustBoundaryElements()
Will refine the elements associated with a boundary condition till there are no elements constrained ...
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
virtual int GetSideOrient(int side)
It returns the normal orientation of the reference element by the side. Only side that has dimension ...
TPZStack< TPZCompEl *, 5 > GetElGroup()
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
void SetAllCreateFunctionsContinuous()
Implements computational element and a side. Computational Element.
int Set(const int index, const int dim, const int pos=-1)
Modifies existing block dimensions or creates a new block with given index.
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
virtual MElementType Type()
Return the type of the element.
virtual void InitializeIntegrationRule() override=0
After adding the elements initialize the integration rule.
std::pair< TPZCompMesh *, int64_t > atomic_index
This class has methods to build the mesh multiphysics.
virtual void SetConnectIndex(int inode, int64_t index)=0
Set the index i to node inode.
int MaterialId() const
Returns the material index of the element.
static void AddElements(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh)
Creating multiphysic elements into mphysics computational mesh. Method to add elements in the mesh mu...
virtual TPZCompEl * Element(int64_t elindex)=0
virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
Add a shape restraint (meant to fit the pyramid to restraint.
TPZGeoElSide Reference() const
Reference to the geometric element.
virtual void AddElement(TPZCompEl *cel, int64_t mesh)=0
Contains the declaration of the TPZElementGroup class, which implements an computational element whic...
virtual int Dimension() const =0
Dimension of the element.
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
static void TransferFromMultiPhysics(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh)
Transfer information from a specific mesh multiphysics for the current specific set of meshes...
void SetLagrangeMultiplier(unsigned char mult)
Set the connect as a pressure connect or not.
virtual int64_t NMeshes()=0
TPZCompMesh * Mesh() const
Returns the pointer to the computational mesh.
int64_t NElements() const
Number of elements of the mesh.
Definition of the retraint associated with the top of the pyramid.
TPZCompEl * ReferenceCompEl()
Contains the declaration of the TPZMultiphysicsElement class. This class is abstract.
TPZCompElSide LowerLevelCompElementList2(int onlyinterpolated)
return the element/side pair which contains this/side and has a computational element associated ...
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Class which groups elements to characterize dense matrices.
const TVar & Get(const int block_row, const int block_col, const int r, const int c) const
Gets a element from matrix verifying.
virtual void SetSideOrient(int side, int sideorient) override
It set the normal orientation of the element by the side. Only side that has dimension equal to my di...
virtual void DefineGraphMesh(int dimension, const TPZVec< std::string > &scalnames, const TPZVec< std::string > &vecnames, const std::string &plotfile)
Define GrapMesh as V3D, DX, MV or VTK depending on extension of the file.
int64_t NElements() const
Access method to query the number of elements of the vector.
REAL val(STATE &number)
Returns value of the variable.
int NDof(TPZCompMesh &mesh)
Number of degrees of freedom associated with the object.
Implements a chunk vector with free store administration. Utility.
TPZManVector< std::pair< int64_t, int >, 4 > fFaces
Faces which are related. First item is the connect index, second item is the degree of freedom...
virtual int NSides() const =0
Returns the number of connectivities of the element.
virtual int SideDimension(int side) const =0
Return the dimension of side.
void EqualLevelCompElementList(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected computational elements which have equal level to the current element...
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
void LoadReferences()
Map this grid in the geometric grid.
TPZBuildMultiphysicsMesh()
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
void CreateDisconnectedElements(bool create)
Determine if the mesh will be created with disconnected elements After the mesh is created...
static void AddConnects(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh)
void SetDefaultOrder(int order)
virtual int IsInterface()
TPZFMatrix< STATE > & Solution()
Returns the solution matrix.
static void AppendConnects(TPZCompMesh *cmesh, TPZCompMesh *MFMesh)
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
unsigned char LagrangeMultiplier() const
Access method to return the indication whether the connect is associated with a pressure lagrange mul...
virtual TPZCompMesh * FatherMesh() const override
Returns the current submesh father mesh.
TPZCompEl * CreateCompEl(TPZGeoEl *gel, int64_t &index)
Create a computational element based on the geometric element.
int Zero() override
Makes Zero all the elements.
int64_t size() const
Returns the number of elements of the vector.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
TPZCompEl * Element(int64_t iel)
void Resize(const int newsize)
Increase the size of the chunk vector.
unsigned char Order() const
Access function to return the order associated with the connect.
TPZCreateApproximationSpace & ApproxSpace()
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
Implements the sequence of actions to perform a finite element analysis. Analysis.
void Push(const T object)
Pushes a copy of the object on the stack.
void EqualLevelElementList(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected elements which have equal level to the current element This method will not put...
void AllNeighbours(TPZStack< TPZGeoElSide > &allneigh)
Returns the set of neighbours which can directly be accessed by the datastructure.
virtual void Divide(int64_t index, TPZVec< int64_t > &subindex, int interpolate=0)
Divide the computational element. If interpolate = 1, the solution is interpolated to the sub element...
virtual void LoadSolution()
Load the solution into the computable grid.
virtual void Print(std::ostream &out=std::cout) const
Print the information of the grid to an ostream.
Structure to reference dependency.
static void TransferFromMeshes(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh)
Transfer information from a specific set of meshes for the current mesh multiphysics.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Implements a group of computational elements as a mesh and an element. Computational Mesh...
#define DebugStop()
Returns a message to user put a breakpoint in.
Contains declaration of TPZInterfaceElement class which computes the contribution over an interface b...
virtual void ExpandSolution()
Adapt the solution vector to new block dimensions.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
int Dimension() const
Returns the dimension of the simulation.
Contains the declaration of the TPZBuildmultiphysicsMesh class.
virtual TPZCompEl * ReferredElement(int64_t mesh)=0
Contains the declaration of multiphysic interface class.
virtual MElementType Type() const =0
Returns the element type acording to pzeltype.h.
int64_t InternalIndex(int64_t IndexinFather)
return the index in the subcompmesh of a connect with index within the father
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.
unsigned int NShape() const
int HasDependency() const
Returns whether exist dependecy information.
virtual TPZGeoEl * CreateBCGeoEl(int side, int bc)=0
Method which creates a geometric element on the side of an existing element.
void SetAllCreateFunctionsContinuous()
Create continuous approximation spaces.
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
void SetNMeshes(int64_t nmeshes)
int64_t NConnects() const
Number of connects allocated including free nodes.
Contains declaration of TPZCompelDisc class which implements a computational element for discontinuou...
REAL co[8][3]
Coordinates of the eight nodes.
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
Class which implements an element which condenses the internal connects.
int64_t Index() const
Returns element index of the mesh fELementVec list.
Implements a generic computational element to HDiv scope. Computational Element.
int SetNBlocks(const int num_of_blocks)
Sets number of blocks on diagonal matrix.
virtual void PostProcess(int resolution)
Draw solution over mesh for all dimensions.
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
unsigned char NState() const
Number of state variables associated with the connect.
static void UniformRefineCompMesh(TPZCompMesh *cMesh, int ndiv, bool isLagrMult=true)
Uniform refinement of the computational mesh.
virtual void SetConnectIndexes(TPZVec< int64_t > &indexes)=0
virtual int64_t ConnectIndex(int i) const =0
Returns the index of the ith connectivity of the element.
Computes the contribution over an interface between two discontinuous elements. Computational Element...
Implements the interfaces for TPZCompElDisc, TPZInterfaceElement and TPZInterpolatedElement. Computational element.
virtual int NConnects() const =0
Returns the number of nodes of the element.
TPZGeoEl * Element() const
Contains declaration of TPZSubCompMesh class which implements a group of computational elements as a ...
virtual std::list< TPZOneShapeRestraint > GetShapeRestraints() const
Return a list with the shape restraints.
virtual int SideConnectLocId(int icon, int is) const =0
Returns the local node number of icon along is.
virtual void CleanUpUnconnectedNodes()
Delete the nodes which have no elements connected to them.
virtual int Dimension() const =0
Returns the dimension of the element.
TPZCompEl * Element() const
Gives a pointer to the reference computational element.
static void UniformRefineCompEl(TPZCompMesh *cMesh, int64_t indexEl, bool isLagrMult)
Uniform refinement of the computational element.
int Put(const int block_row, const int block_col, const int r, const int c, const TVar &value)
Puts a element to matrix verifying.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
static void BuildHybridMesh(TPZCompMesh *cmesh, std::set< int > &MaterialIDs, std::set< int > &BCMaterialIds, int LagrangeMat, int InterfaceMat)
Creating computational mesh with interface elements.
This class implements a geometric mesh for the pz environment. Geometry.
MElementType
Define the element types.
void ResetReference()
Reset the element referenced by the geometric element to NULL.
Computes the contribution over an interface between two discontinuous elements. Computational Element...
TPZDepend * FirstDepend()
Contains declaration of TPZCompElHDivBound2 class which implements a generic computational element (H...
Implements computational mesh. Computational Mesh.
int Size(const int block_diagonal) const
Returns block dimension.
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
void BuildMesh(TPZCompMesh &cmesh, const std::set< int > &MaterialIDs) const
Creates the computational elements, and the degree of freedom nodes.
~TPZBuildMultiphysicsMesh()
void RemoveDepend(int64_t myindex, int64_t dependindex)
Remove dependency between connects if exist.
int InterfaceMaterial(int leftmaterial, int rightmaterial)
Returns the interface material associated to left and right element materials. If no interface materi...
int64_t NElements() const
Returns the number of elements of the vector.
static void ShowShape(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh, TPZAnalysis &analysis, const std::string &filename, TPZVec< int64_t > &equationindices)
Show shape functions associated with connects of a multiphysics mesh.
void SetCenterPoint(int i, REAL x)
static void AddWrap(TPZMultiphysicsElement *mfcel, int matskeleton, TPZStack< TPZStack< TPZMultiphysicsElement *, 7 > > &ListGroupEl)
Create skeleton elements of the wrap of me.
clarg::argInt porder("-porder", "polinomial order", 1)
static void ComputeAtomicIndexes(TPZCompMesh *mesh, TPZVec< atomic_index > &indexes)
This class implements a discontinuous element (for use with discontinuous Galerkin). Computational Element.
virtual bool IsActiveApproxSpaces(int space_index)
void InitializeBlock()
Resequence the block object, remove unconnected connect objects and reset the dimension of the soluti...
void ResetReference()
Resets all load references in elements and nodes.
Defines the interface of a computational element. Computational Element.
Contains the declaration of the TPZCondensedCompEl class, which implements an computational element w...
void push_back(const T object)
TPZGeoEl * Father() const
Computes the normal vectors needed for forming HDiv vector valued shape functions.
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
TPZFMatrix< STATE > & Solution()
Access the solution vector.
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.
static void FillAtomic(TPZCompEl *cel, TPZVec< atomic_index > &indexes)