27 REAL maxvel = 0.0, veloc, sound,
gamma;
43 if(!mat)
PZError <<
"TPZFlowCompMesh::MaxVelocityOfMesh ERROR: null material.\n";
46 if(!pElGeo)
PZError <<
"TPZFlowCompMesh::MaxVelocityOfMesh ERROR: null element.\n";
55 if(!law)
PZError <<
"TPZFlowCompMesh::MaxVelocityOfMesh2 ERROR: non-fluid material.\n";
63 if(density[0] < 0.0)
PZError <<
"TPZFlowCompMesh::MaxVelocityOfMesh: Negative density\n";
74 if(press < 0.0)
PZError <<
"TPZFlowCompMesh::MaxVelocityOfMesh Negative pressure\n";
79 sound =
sqrt(gamma*press/density[0]);
82 veloc = velocity[0] + sound;
83 if(veloc > maxvel) maxvel = veloc;
94 std::map<int, TPZMaterial * >::iterator matit;
103 int index = pConsLaw->
Id();
116 REAL meanTimeStep = 0.;
119 for(iel=0; iel<nel; iel++)
136 meanTimeStep += mat->
SetTimeStep(maxVel, deltax, porder);
140 return meanTimeStep / (double)numcontr;
147 #define FL(A) dynamic_cast<TPZConservationLaw *>(A->second) 158 std::map<int, TPZMaterial * >::iterator matit;
161 FL(matit)->SetCFL(CFL);
167 std::map<int, TPZMaterial * >::iterator matit;
170 REAL newCFL =
FL(matit)->CFL()*scale;
172 cout <<
"CFL = " << newCFL << endl;
173 FL(matit)->SetCFL(newCFL);
180 std::map<int, TPZMaterial * >::iterator matit;
183 FL(matit)->SetContributionTime(time);
189 std::map<int, TPZMaterial * >::iterator matit;
192 FL(matit)->SetForcingFunction(fp);
223 std::map<int, TPZMaterial * >::iterator matit;
226 FL(matit)->SetResidualType(type);
256 PZError <<
"\nTPZFlowCompMesh::ExpandSolution - Wrong number of fluid materials\n";
265 for(ic=0; ic<cols; ic++) {
266 for(ibl = 0;ibl<nblocks;ibl++) {
269 int lastStatePos = position + size - nstate;
273 for(ieq=0; ieq<nstate; ieq++) {
283 for(ic=0; ic<cols; ic++) {
284 for(ibl = 0;ibl<nblocks;ibl++) {
287 int lastStatePos = position + size - nstate;
291 for(ieq=0; ieq<nstate; ieq++) {
virtual int NStateVariables() const override=0
Number of state variables according to the dimension.
REAL ComputeTimeStep()
Computes the current time step for the mesh.
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
void Read(TPZStream &buf, void *context) override
Read the element data from a stream.
int NFlowMaterials()
Returns the number of Flow materials.
Implements a vector class which allows to use external storage provided by the user. Utility.
void SetTimeStep(REAL timeStep)
Sets the time step used for time integration.
TPZFMatrix< STATE > fSolution
Solution vector.
TPZAdmChunkVector< TPZCompEl * > fElementVec
List of pointers to elements.
void ScaleCFL(REAL scale)
Scales the CFL of all materials.
int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
void CollectFluidMaterials()
Should be called after all materials have been added to the mesh.
virtual int Dimension() const =0
Returns the integrable dimension of the material.
int64_t NElements() const
Access method to query the number of elements of the vector.
virtual int NSides() const =0
Returns the number of connectivities of the element.
virtual void ExpandSolution2()
Adapt the solution vector to new block dimensions.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
virtual STATE Pressure(TPZVec< STATE > &U)=0
Thermodynamic pressure determined by the law of an ideal gas.
This abstract class defines the behaviour which each derived class needs to implement.
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...
Computational mesh with additional data for CFD problems. Computational Mesh.
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
#define MAXCFL
Maxime value to CFL coefficient.
int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
TPZMaterial * GetFlowMaterial()
Returns the first flow material in the mesh.
REAL MaxVelocityOfMesh()
According to each material settings, it returns the greatest velocity in the mesh.
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
TPZResidualType
Which terms are being contributed.
void SetContributionTime(TPZContributeTime time)
Informs the time at which the current solution in the computational mesh belongs, so that the materia...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
std::map< int, TPZMaterial *> fFluidMaterial
This vector of pointers represent the collection of all fluid materials in the mesh.
void Read(TPZStream &buf, void *context) override
Read the element data from a stream.
virtual void ExpandSolution()
Adapt the solution vector to new block dimensions.
void SetResidualType(TPZResidualType type)
Sets the kind of residual to be computed.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Contains declaration of TPZCompelDisc class which implements a computational element for discontinuou...
void SetFlowforcingFunction(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets the forcing funtion for all fluid materials in the mesh.
virtual int PreferredSideOrder(int iside)=0
Returns the preferred order of the polynomial along side iside.
virtual void ComputeSolution(TPZVec< REAL > &qsi, TPZMaterialData &data)
TPZBlock< STATE > fBlock
Block structure to right construction of the stiffness matrix and load vector.
int32_t Hash(std::string str)
long double gamma(unsigned int n)
Evaluate the factorial of a integer.
int NBlocks() const
Returns number of blocks on diagonal.
TPZBlock< STATE > fSolutionBlock
Block structure of the solution vector ????
Implements the interface for conservation laws, keeping track of the timestep as well.
virtual void AutoBuild() override
Creates the computational elements, and the degree of freedom nodes.
#define FL(A)
Function for dynamic cast of the material based on map A (second data)
virtual int Dimension() const =0
Returns the dimension of the element.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
This class implements a geometric mesh for the pz environment. Geometry.
Contains declaration of TPZFlowCompMesh class which is a computational mesh with additional data for ...
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.
virtual void Solution(TPZVec< REAL > &qsi, int var, TPZVec< STATE > &sol)
Calculates the solution - sol - for the variable var at point qsi, where qsi is expressed in terms of...
void SetCFL(REAL CFL)
Informs all materials the CFL number.
Contains declaration of TPZInterpolatedElement class which implements computational element of the in...
int64_t Cols() const
Returns number of cols.
virtual int Degree() const
Returns the degree of interpolation of the element.
std::map< int, TPZMaterial *> fMaterialVec
Map of pointers to materials.
Defines the interface for saving and reading data. Persistency.
clarg::argInt porder("-porder", "polinomial order", 1)
This class implements a discontinuous element (for use with discontinuous Galerkin). Computational Element.
Defines the interface of a computational element. Computational Element.
TPZContributeTime
Indicates which term is put in the right hand side and tangent matrix.
virtual void AutoBuild()
Creates the computational elements, and the degree of freedom nodes.
void Write(TPZStream &buf, int withclassid) const override
Save the element data to a stream.
Implements computational element based on an interpolation space. Computational Element.
Implements an interface to register a class id and a restore function. Persistence.
#define PZError
Defines the output device to error messages and the DebugStop() function.
int Resequence(const int start=0)
Resequences blocks positioning.
REAL Gamma()
Returns the value of Gamma (constant of gas)
This class implements a reference counter mechanism to administer a dynamically allocated object...