NeoPZ
Public Member Functions | Protected Attributes | List of all members

Computational mesh with additional data for CFD problems. Computational Mesh. More...

#include <pzflowcmesh.h>

Inheritance diagram for TPZFlowCompMesh:
[legend]
Collaboration diagram for TPZFlowCompMesh:
[legend]

Public Member Functions

 TPZFlowCompMesh (TPZGeoMesh *gr)
 
 TPZFlowCompMesh ()
 
 ~TPZFlowCompMesh ()
 
REAL MaxVelocityOfMesh ()
 According to each material settings, it returns the greatest velocity in the mesh. More...
 
REAL ComputeTimeStep ()
 Computes the current time step for the mesh. More...
 
void SetCFL (REAL CFL)
 Informs all materials the CFL number. More...
 
void ScaleCFL (REAL scale)
 Scales the CFL of all materials. More...
 
void CollectFluidMaterials ()
 Should be called after all materials have been added to the mesh. More...
 
void SetContributionTime (TPZContributeTime time)
 Informs the time at which the current solution in the computational mesh belongs, so that the materials can choose whether to contribute implicitly or explicitly. More...
 
void SetResidualType (TPZResidualType type)
 Sets the kind of residual to be computed. More...
 
void SetFlowforcingFunction (TPZAutoPointer< TPZFunction< STATE > > fp)
 Sets the forcing funtion for all fluid materials in the mesh. More...
 
virtual void AutoBuild () override
 Creates the computational elements, and the degree of freedom nodes. More...
 
TPZMaterialGetFlowMaterial ()
 Returns the first flow material in the mesh. More...
 
int NFlowMaterials ()
 Returns the number of Flow materials. More...
 
int ClassId () const override
 Returns the unique identifier for reading/writing objects to streams. More...
 
void Write (TPZStream &buf, int withclassid) const override
 Saves the element data to a stream. More...
 
void Read (TPZStream &buf, void *context) override
 Read the element data from a stream. More...
 
virtual void ExpandSolution2 ()
 Adapt the solution vector to new block dimensions. More...
 
- Public Member Functions inherited from TPZCompMesh
 TPZCompMesh (TPZGeoMesh *gr=0)
 Constructor from geometrical mesh. More...
 
 TPZCompMesh (TPZAutoPointer< TPZGeoMesh > &gmesh)
 Constructor based on an autopointer to a geometric mesh. More...
 
 TPZCompMesh (const TPZCompMesh &copy)
 Copy constructor. More...
 
TPZCompMeshoperator= (const TPZCompMesh &copy)
 copy the content of the mesh More...
 
virtual ~TPZCompMesh ()
 Simple Destructor. More...
 
virtual REAL CompareMesh (int var, char *matname)
 This method will initiate the comparison between the current computational mesh and the mesh which is referenced by the geometric mesh. More...
 
void GetRefPatches (std::set< TPZGeoEl *> &grpatch)
 Gives all patches of the mesh. More...
 
void GetNodeToElGraph (TPZVec< int64_t > &nodtoelgraph, TPZVec< int64_t > &nodtoelgraphinde, TPZStack< int64_t > &elgraph, TPZVec< int64_t > &elgraphindexx)
 Gives the conects graphs. More...
 
void GetElementPatch (TPZVec< int64_t > nodtoelgraph, TPZVec< int64_t > nodtoelgraphindex, TPZStack< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex, int64_t elind, TPZStack< int64_t > &patch)
 Gives the element patch. More...
 
void SetName (const std::string &nm)
 Set the mesh name. More...
 
void SetDimModel (int dim)
 Set de dimension of the domain of the problem. More...
 
void SetReference (TPZGeoMesh *gmesh)
 Sets the geometric reference mesh. More...
 
void SetReference (TPZAutoPointer< TPZGeoMesh > &gmesh)
 Sets the geometric reference mesh. More...
 
int Dimension () const
 Returns the dimension of the simulation. More...
 
std::string & Name ()
 Returns the mesh name. More...
 
void CleanUp ()
 Delete all the dynamically allocated data structures. More...
 
TPZMaterialFindMaterial (int id)
 Find the material with identity id. More...
 
void LoadReferences ()
 Map this grid in the geometric grid. More...
 
virtual void ComputeNodElCon ()
 Compute the number of elements connected to each connect object. More...
 
virtual void ComputeNodElCon (TPZVec< int > &nelconnected) const
 Compute the number of elements connected to each connect object. More...
 
virtual void CleanUpUnconnectedNodes ()
 Delete the nodes which have no elements connected to them. More...
 
void ComputeElGraph (TPZStack< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex)
 Computes the connectivity graph of the elements, as appropriate for the TPZRenumbering class. More...
 
void ComputeElGraph (TPZStack< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex, std::set< int > &mat_ids)
 Computes the connectivity graph of the elements, as appropriate for the TPZRenumbering class. More...
 
virtual void BuildCornerConnectList (std::set< int64_t > &connectindexes) const
 adds the connect indexes associated with base shape functions to the set More...
 
int GetDefaultOrder ()
 
void SetDefaultOrder (int order)
 
TPZCompMeshClone () const
 Clone this mesh. More...
 
void CopyMaterials (TPZCompMesh &mesh) const
 Copies the materials of this mesh to the given mesh. More...
 
REAL DeltaX ()
 
REAL MaximumRadiusOfMesh ()
 
REAL LesserEdgeOfMesh ()
 
TPZCompMeshComputeMesh (TPZVec< int64_t > &accumlist, int64_t numaggl)
 Creates a mesh inserting into accumlist the element list to more refined mesh. More...
 
void ComputeFillIn (int64_t resolution, TPZFMatrix< REAL > &fillin)
 This method will fill the matrix passed as parameter with a representation of the fillin of the global stiffness matrix, based on the sequence number of the connects. More...
 
int64_t NConnects () const
 Number of connects allocated including free nodes. More...
 
int64_t NIndependentConnects ()
 Number of independent connect objects. More...
 
int64_t NElements () const
 Number of computational elements allocated. More...
 
size_t NMaterials () const
 Number of materials. More...
 
TPZAdmChunkVector< TPZCompEl * > & ElementVec ()
 Returns a reference to the element pointers vector. More...
 
TPZCompElElement (int64_t iel)
 
const TPZCompElElement (int64_t iel) const
 
const TPZAdmChunkVector< TPZCompEl * > & ElementVec () const
 Returns a reference to the element pointers vector. More...
 
TPZAdmChunkVector< TPZConnect > & ConnectVec ()
 Return a reference to the connect pointers vector. More...
 
const TPZAdmChunkVector< TPZConnect > & ConnectVec () const
 
std::map< int,TPZMaterial *> & MaterialVec ()
 Returns a reference to the material pointers vector. More...
 
std::map< int,TPZMaterial *> MaterialVec () const
 Returns a reference to the material pointers vector. More...
 
TPZGeoMeshReference () const
 Returns a pointer to the geometrical mesh associated. More...
 
const TPZBlock< STATE > & Block () const
 Access the block structure of the solution vector. More...
 
TPZBlock< STATE > & Block ()
 Access the block structure of the solution vector. More...
 
TPZFMatrix< STATE > & Solution ()
 Access the solution vector. More...
 
TPZFMatrix< STATE > & SolutionN ()
 Access the previous solution vector. More...
 
TPZFMatrix< STATE > & ElementSolution ()
 Access method for the element solution vectors. More...
 
virtual int64_t AllocateNewConnect (int nshape, int nstate, int order)
 Returns an index to a new connect. More...
 
virtual int64_t AllocateNewConnect (const TPZConnect &connect)
 Returns an index to a new connect. More...
 
int InsertMaterialObject (TPZMaterial *mat)
 Insert a material object in the datastructure. More...
 
void InitializeBlock ()
 Resequence the block object, remove unconnected connect objects and reset the dimension of the solution vector. More...
 
virtual void ExpandSolution ()
 Adapt the solution vector to new block dimensions. More...
 
void SetElementSolution (int64_t i, TPZVec< STATE > &sol)
 Set a ith element solution, expanding the element-solution matrix if necessary. More...
 
virtual void Print (std::ostream &out=std::cout) const
 Prints mesh data. More...
 
void ConnectSolution (std::ostream &out)
 Print the solution by connect index. More...
 
virtual TPZCompMeshFatherMesh () const
 Get the father meshes stack. More...
 
virtual void MakeInternal (int64_t local)
 Makes a specified connection a internal mesh connection. More...
 
virtual void MakeAllInternal ()
 Make all mesh connections internal mesh connections. Connects to an internal connection. More...
 
virtual TPZCompMeshRootMesh (int64_t local)
 Returns the rootmesh who have the specified connection. More...
 
virtual int64_t TransferElementFrom (TPZCompMesh *mesh, int64_t elindex)
 Transfer one element from a specified mesh to the current submesh. More...
 
virtual int64_t TransferElementTo (TPZCompMesh *mesh, int64_t elindex)
 Transfer one element from a submesh to another mesh. More...
 
virtual int64_t TransferElement (TPZCompMesh *mesh, int64_t elindex)
 Transfer one element form a submesh to another mesh. More...
 
virtual int64_t PutinSuperMesh (int64_t local, TPZCompMesh *super)
 Put an local connection in the supermesh - Supermesh is one mesh who contains the analised submesh. More...
 
virtual int64_t GetFromSuperMesh (int64_t superind, TPZCompMesh *super)
 Get an external connection from the supermesh - Supermesh is one mesh who contains the analised submesh. More...
 
virtual TPZCompMeshCommonMesh (TPZCompMesh *mesh)
 Gives the commom father mesh of the specified mesh and the current submesh. More...
 
int64_t NEquations ()
 This computes the number of equations associated with non-restrained nodes. More...
 
int BandWidth ()
 This method computes the bandwidth of the system of equations. More...
 
virtual void Skyline (TPZVec< int64_t > &skyline)
 This method computes the skyline of the system of equations. More...
 
void AssembleError (TPZFMatrix< REAL > &estimator, int errorid)
 Assemble the vector with errors estimators. More...
 
void BuildTransferMatrix (TPZCompMesh &coarsemesh, TPZTransfer< STATE > &transfer)
 Builds the transfer matrix from the current grid to the coarse grid. More...
 
void BuildTransferMatrixDesc (TPZCompMesh &transfermesh, TPZTransfer< STATE > &transfer)
 To discontinuous elements. More...
 
void ProjectSolution (TPZFMatrix< STATE > &projectsol)
 
void SetNMeshes (int64_t nmeshes)
 
int64_t GetNMeshes ()
 
TPZCompElCreateCompEl (TPZGeoEl *gel, int64_t &index)
 Create a computational element based on the geometric element. More...
 
virtual void AutoBuild (const std::set< int > &MaterialIDs)
 Creates the computational elements, and the degree of freedom nodes. More...
 
void AutoBuild (const TPZVec< int64_t > &gelindexes)
 build the computational elements for the geometric element indexes More...
 
virtual void AutoBuildContDisc (const TPZVec< TPZGeoEl *> &continuous, const TPZVec< TPZGeoEl *> &discontinuous)
 Creates the computational elements, and the degree of freedom nodes. More...
 
TPZCreateApproximationSpaceApproxSpace ()
 
void SetAllCreateFunctionsDiscontinuous ()
 
void SetAllCreateFunctionsContinuous ()
 
void SetAllCreateFunctionsDiscontinuousReferred ()
 
void SetAllCreateFunctionsContinuousReferred ()
 
void SetAllCreateFunctionsHDiv ()
 
void SetAllCreateFunctionsHDivPressure ()
 
void SetAllCreateFunctions (TPZCompEl &cel)
 
void SetAllCreateFunctionsMultiphysicElem ()
 
void SetAllCreateFunctionsMultiphysicElemWithMem ()
 
void SetAllCreateFunctionsContinuousWithMem ()
 
int Consolidate ()
 Will build the list of element boundary conditions build the list of connect boundary conditions. More...
 
int Check ()
 
void LoadSolution (const TPZFMatrix< STATE > &sol)
 Given the solution of the global system of equations, computes and stores the solution for the restricted nodes. More...
 
void UpdatePreviousState (STATE mult=1.0)
 
void TransferMultiphysicsSolution ()
 Transfer multiphysics mesh solution. More...
 
void Divide (int64_t index, TPZVec< int64_t > &subindex, int interpolate=0)
 Divide the element corresponding to index. More...
 
void Coarsen (TPZVec< int64_t > &elements, int64_t &index, bool CreateDiscontinuous=false)
 Create a computational element father for the comp. elem. into elements. More...
 
void RemakeAllInterfaceElements ()
 Deletes all interfaces and rebuild them all. More...
 
void AdjustBoundaryElements ()
 Will refine the elements associated with a boundary condition till there are no elements constrained by boundary condition elements. More...
 
void Permute (TPZVec< int64_t > &permute)
 Permute the sequence number of the connect objects It is a permute gather operation. More...
 
void SaddlePermute ()
 Put the sequence number of the pressure connects after the seq number of the flux connects. More...
 
void SaddlePermute2 ()
 
TPZVec< STATE > Integrate (const std::string &varname, const std::set< int > &matids)
 Integrate the variable name over the mesh. More...
 
void EvaluateError (std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)> fp, bool store_error, TPZVec< REAL > &errorSum)
 Evaluates the error given the two vectors of the analised parameters. More...
 
void ConvertDiscontinuous2Continuous (REAL eps, int opt, int dim, TPZVec< STATE > &celJumps)
 This method compute the jump solution of interface and convert discontinuous elements with jump less than eps in continuous elements. More...
 
void Discontinuous2Continuous (int64_t disc_index, int64_t &new_index)
 This method convert a discontinuous element with index disc_index in continuous element. More...
 
- Public Member Functions inherited from TPZSavable
 TPZSavable ()
 
virtual ~TPZSavable ()
 
virtual std::list< std::map< std::string, uint64_t > > VersionHistory () const
 
virtual std::pair< std::string, uint64_t > Version () const
 
virtual bool Compare (TPZSavable *copy, bool override=false)
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
virtual bool Compare (TPZSavable *copy, bool override=false) const
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
- Public Member Functions inherited from TPZRegisterClassId
template<typename T >
 TPZRegisterClassId (int(T::*)() const)
 
 TPZRegisterClassId ()=default
 

Protected Attributes

std::map< int, TPZMaterial *> fFluidMaterial
 This vector of pointers represent the collection of all fluid materials in the mesh. More...
 
- Protected Attributes inherited from TPZCompMesh
TPZGeoMeshfReference
 Geometric grid to which this grid refers. More...
 
TPZAutoPointer< TPZGeoMeshfGMesh
 Autopointer to the geometric mesh used in case the user has passed an autopointer. More...
 
std::string fName
 Grid name for model identification. More...
 
TPZAdmChunkVector< TPZCompEl * > fElementVec
 List of pointers to elements. More...
 
TPZAdmChunkVector< TPZConnectfConnectVec
 List of pointers to nodes. More...
 
std::map< int, TPZMaterial *> fMaterialVec
 Map of pointers to materials. More...
 
TPZBlock< STATE > fSolutionBlock
 Block structure of the solution vector ???? More...
 
TPZFMatrix< STATE > fSolution
 Solution vector. More...
 
TPZFMatrix< STATE > fSolN
 Solution at previous state. More...
 
TPZBlock< STATE > fBlock
 Block structure to right construction of the stiffness matrix and load vector. More...
 
TPZFMatrix< STATE > fElementSolution
 Solution vectors organized by element. More...
 
int fDimModel
 
int fDefaultOrder
 Default order for all elements of this mesh. More...
 
TPZCreateApproximationSpace fCreate
 The object which defines the type of space being created. More...
 
int64_t fNmeshes
 

Additional Inherited Members

- Static Public Member Functions inherited from TPZSavable
static std::set< TPZRestoreClassBase * > & RestoreClassSet ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::map< int, TPZRestore_t > & ClassIdMap ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::pair< std::string, uint64_t > NeoPZVersion ()
 
static void Register (TPZRestoreClassBase *restore)
 
static void RegisterClassId (int classid, TPZRestore_t fun)
 
static TPZSavableCreateInstance (const int &classId)
 
- Protected Member Functions inherited from TPZCompMesh
void ModifyPermute (TPZVec< int64_t > &permute, int64_t lagrangeq, int64_t maxeq)
 Modify the permute vector swapping the lagrangeq with maxeq and shifting the intermediate equations. More...
 

Detailed Description

Computational mesh with additional data for CFD problems. Computational Mesh.

This class implements the additions behavior and data to handle CFD problems as computional meshes.

Definition at line 27 of file pzflowcmesh.h.

Constructor & Destructor Documentation

◆ TPZFlowCompMesh() [1/2]

TPZFlowCompMesh::TPZFlowCompMesh ( TPZGeoMesh gr)

Definition at line 12 of file pzflowcmesh.cpp.

◆ TPZFlowCompMesh() [2/2]

TPZFlowCompMesh::TPZFlowCompMesh ( )

Definition at line 17 of file pzflowcmesh.cpp.

◆ ~TPZFlowCompMesh()

TPZFlowCompMesh::~TPZFlowCompMesh ( )
inline

Member Function Documentation

◆ AutoBuild()

void TPZFlowCompMesh::AutoBuild ( )
overridevirtual

Creates the computational elements, and the degree of freedom nodes.

In this reimplementation, also calls CollectFluidMaterials;

Reimplemented from TPZCompMesh.

Definition at line 196 of file pzflowcmesh.cpp.

References TPZCompMesh::AutoBuild(), and CollectFluidMaterials().

Referenced by ~TPZFlowCompMesh().

◆ ClassId()

int TPZFlowCompMesh::ClassId ( ) const
overridevirtual

Returns the unique identifier for reading/writing objects to streams.

Reimplemented from TPZCompMesh.

Reimplemented in TPZAgglomerateMesh.

Definition at line 230 of file pzflowcmesh.cpp.

References TPZCompMesh::ClassId(), and Hash().

Referenced by TPZAgglomerateMesh::ClassId(), and ~TPZFlowCompMesh().

◆ CollectFluidMaterials()

void TPZFlowCompMesh::CollectFluidMaterials ( )

Should be called after all materials have been added to the mesh.

This method collects all fluid materials and stores a pointer to them in the vector fFluidMaterial.

Definition at line 92 of file pzflowcmesh.cpp.

References fFluidMaterial, TPZCompMesh::fMaterialVec, and TPZMaterial::Id().

Referenced by AutoBuild(), Read(), and ~TPZFlowCompMesh().

◆ ComputeTimeStep()

REAL TPZFlowCompMesh::ComputeTimeStep ( )

◆ ExpandSolution2()

void TPZFlowCompMesh::ExpandSolution2 ( )
virtual

◆ GetFlowMaterial()

TPZMaterial * TPZFlowCompMesh::GetFlowMaterial ( )

Returns the first flow material in the mesh.

Returns the first flow material in the mesh

Definition at line 209 of file pzflowcmesh.cpp.

References fFluidMaterial.

Referenced by TPZEulerAnalysis::PrepareDXMesh(), and ~TPZFlowCompMesh().

◆ MaxVelocityOfMesh()

REAL TPZFlowCompMesh::MaxVelocityOfMesh ( )

◆ NFlowMaterials()

int TPZFlowCompMesh::NFlowMaterials ( )

Returns the number of Flow materials.

Definition at line 203 of file pzflowcmesh.cpp.

References fFluidMaterial.

Referenced by ~TPZFlowCompMesh().

◆ Read()

void TPZFlowCompMesh::Read ( TPZStream buf,
void *  context 
)
overridevirtual

Read the element data from a stream.

Reimplemented from TPZCompMesh.

Definition at line 244 of file pzflowcmesh.cpp.

References CollectFluidMaterials(), and TPZCompMesh::Read().

Referenced by ~TPZFlowCompMesh().

◆ ScaleCFL()

void TPZFlowCompMesh::ScaleCFL ( REAL  scale)

Scales the CFL of all materials.

Definition at line 165 of file pzflowcmesh.cpp.

References fFluidMaterial, FL, and MAXCFL.

Referenced by TPZEulerAnalysis::CFLControl(), TPZEulerAnalysis::UpdateSolAndRhs(), and ~TPZFlowCompMesh().

◆ SetCFL()

void TPZFlowCompMesh::SetCFL ( REAL  CFL)

Informs all materials the CFL number.

User must call CollectFluidMaterials first.

Definition at line 155 of file pzflowcmesh.cpp.

References fFluidMaterial, FL, and MAXCFL.

Referenced by ~TPZFlowCompMesh().

◆ SetContributionTime()

void TPZFlowCompMesh::SetContributionTime ( TPZContributeTime  time)

Informs the time at which the current solution in the computational mesh belongs, so that the materials can choose whether to contribute implicitly or explicitly.

Definition at line 178 of file pzflowcmesh.cpp.

References fFluidMaterial, and FL.

Referenced by TPZEulerAnalysis::SetContributionTime(), and ~TPZFlowCompMesh().

◆ SetFlowforcingFunction()

void TPZFlowCompMesh::SetFlowforcingFunction ( TPZAutoPointer< TPZFunction< STATE > >  fp)

Sets the forcing funtion for all fluid materials in the mesh.

Definition at line 187 of file pzflowcmesh.cpp.

References fFluidMaterial, and FL.

Referenced by TPZEulerAnalysis::Run(), and ~TPZFlowCompMesh().

◆ SetResidualType()

void TPZFlowCompMesh::SetResidualType ( TPZResidualType  type)

Sets the kind of residual to be computed.

Definition at line 221 of file pzflowcmesh.cpp.

References fFluidMaterial, and FL.

Referenced by TPZEulerAnalysis::EvaluateFluxEpsilon(), and ~TPZFlowCompMesh().

◆ Write()

void TPZFlowCompMesh::Write ( TPZStream buf,
int  withclassid 
) const
overridevirtual

Saves the element data to a stream.

Reimplemented from TPZCompMesh.

Definition at line 239 of file pzflowcmesh.cpp.

References TPZCompMesh::Write().

Referenced by TPZEulerAnalysis::WriteCMesh(), and ~TPZFlowCompMesh().

Member Data Documentation

◆ fFluidMaterial

std::map<int, TPZMaterial* > TPZFlowCompMesh::fFluidMaterial
protected

This vector of pointers represent the collection of all fluid materials in the mesh.

These are the materials that deserve special attention during the contribution processes.

Definition at line 94 of file pzflowcmesh.h.

Referenced by CollectFluidMaterials(), ExpandSolution2(), GetFlowMaterial(), NFlowMaterials(), ScaleCFL(), SetCFL(), SetContributionTime(), SetFlowforcingFunction(), and SetResidualType().


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