NeoPZ
|
Implements an analysis procedure for computing the steady state solution of a compressible Euler flow simulation. Analysis. More...
#include <pzeuleranalysis.h>
Public Member Functions | |
TPZEulerAnalysis () | |
Default constructor. More... | |
TPZEulerAnalysis (TPZFlowCompMesh *mesh, std::ostream &out=std::cout) | |
Constructor over computational mesh. out is not used. More... | |
~TPZEulerAnalysis () | |
Simple destructor. More... | |
void | WriteCMesh (const char *str) |
Writes the computational mesh onto disk. More... | |
virtual void | Run (std::ostream &out, const std::string &dxout, int dxRes) |
See declaration in the base class. More... | |
virtual void | Run (std::ostream &out) |
See declaration in the base class. More... | |
void | SetAdvancedState () |
Sets the solution vector to be the one representing the Advanced State (Wn+1) or the advanced implicit solution. More... | |
void | SetLastState () |
Sets the solution vector to be the one representing the Current State (Wn) or the last explicit solution. More... | |
void | SetContributionTime (TPZContributeTime time) |
Informs the Analysis class 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 | SetEvolCFL (int EvolCFL) |
Indicates whether the CFL is to evolute or not. More... | |
void | UpdateSolAndRhs (TPZFMatrix< STATE > &deltaSol, REAL &epsilon) |
Adds deltaSol to the last solution and stores it as the current solution, preparing it to contribute again. More... | |
void | UpdateHistory () |
After a call to UpdateSolution, this method shifts the history in one solution, so that the current solution in the last iteration becomes the last solution in the newest iteration. This method does not reset the current solution. To reset it, UpdateSolution with a deltaSol containing any valid value (zeros, for instance) must be called. More... | |
void | BufferLastStateAssemble () |
Buffers the assemblage of the rhs with respect to the last state. More... | |
REAL | EvaluateFluxEpsilon () |
Evaluates the flux part of the residual for convergence check. More... | |
virtual void | Assemble () |
Assembles the stiffness matrix. More... | |
virtual void | AssembleRhs () |
Assembles the right hand side vector. More... | |
int | Solve (REAL &res, TPZFMatrix< STATE > *residual, TPZFMatrix< STATE > &delSol) |
Solves an assembled stiffness matrix. More... | |
virtual void | Solve () |
Invert the stiffness matrix. More... | |
int | RunNewton (REAL &epsilon, int &numIter) |
Implements the Newton's method. More... | |
REAL | ComputeTimeStep () |
Defines the time step for each material in the mesh. More... | |
void | SetNewtonCriteria (REAL epsilon, int maxIter) |
Settings for the Newton's method. More... | |
void | SetTimeIntCriteria (REAL epsilon, int maxIter) |
Settings for the time integration method. More... | |
TPZDXGraphMesh * | PrepareDXMesh (const std::string &dxout, int dxRes) |
Prepares the DX graph mesh. More... | |
void | SetBlockDiagonalPrecond (TPZBlockDiagonal< STATE > *blockDiag) |
Informs a block diagonal to be used as preconditioning. More... | |
int | LineSearch (REAL &residual, TPZFMatrix< STATE > &sol0, TPZFMatrix< STATE > &dir) |
This method will search for the solution which minimizes the residual. More... | |
void | CompareRhs () |
Trying difference between two times. More... | |
void | CFLControl (REAL &lastEpsilon, REAL &epsilon, REAL &epsilon_Newton, REAL &timeStep) |
Evaluates the CFL control based on the newest residual norm (epsilon) and last residual norm (lastEpsilon). More... | |
void | SetGMResFront (REAL tol, int numiter, int numvectors) |
Set to solve with GMRes algorithm. More... | |
void | SetFrontalSolver () |
Set to solve with Frontal method. More... | |
void | SetGMResBlock (REAL tol, int numiter, int numvec) |
Set to solve with GMRes algorithm for block diagonal matrix. More... | |
Public Member Functions inherited from TPZAnalysis | |
TPZAnalysis (TPZCompMesh *mesh, bool mustOptimizeBandwidth=true, std::ostream &out=std::cout) | |
Create an TPZAnalysis object from one mesh pointer. More... | |
TPZAnalysis (TPZAutoPointer< TPZCompMesh > mesh, bool mustOptimizeBandwidth=true, std::ostream &out=std::cout) | |
Create an TPZAnalysis object from one mesh auto pointer object. More... | |
void | SetGuiInterface (TPZAutoPointer< TPZGuiInterface > gui) |
Defines gui interface object. More... | |
TPZAutoPointer< TPZGuiInterface > | GetGuiInterface () const |
Gets gui interface object. More... | |
bool | AmIKilled () |
Returns if the process was canceled through gui interface. More... | |
virtual void | SetCompMesh (TPZCompMesh *mesh, bool mustOptimizeBandwidth) |
Set the computational mesh of the analysis. More... | |
TPZAnalysis () | |
Create an empty TPZAnalysis object. More... | |
void | Write (TPZStream &buf, int withclassid) const override |
Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More... | |
void | Read (TPZStream &buf, void *context) override |
read objects from the stream More... | |
virtual | ~TPZAnalysis (void) |
Destructor: deletes all protected dynamic allocated objects. More... | |
void | CleanUp () |
deletes all data structures More... | |
void | SetRenumber (TPZAutoPointer< TPZRenumbering > renumber) |
Change the renumbering scheme. More... | |
void | OptimizeBandwidth () |
Sets the computer connection block number from the graphical connections block number otimization. More... | |
int | HighestDimension () |
Returns the dimension of the material which has the highest dimension. More... | |
void | Resequence (int firstel=-1) |
Recompute the node sequence. More... | |
int | ComputeNumberofLoadCases () |
Determine the number of load cases from the material objects and return its value. More... | |
virtual void | AssembleResidual () |
Assemble the load vector. More... | |
TPZFMatrix< STATE > & | Rhs () |
Returns the load vector. More... | |
TPZFMatrix< STATE > & | Solution () |
Returns the solution matrix. More... | |
TPZCompMesh * | Mesh () const |
Returns the pointer to the computational mesh. More... | |
TPZAutoPointer< TPZStructMatrix > | StructMatrix () |
Returns a reference to the structural matrix. More... | |
TPZMatrixSolver< STATE > * | BuildPreconditioner (EPrecond preconditioner, bool overlap) |
Define the type of preconditioner used. More... | |
void | SetStep (int step) |
ste the step for post processing More... | |
void | SetThreadsForError (int nthreads) |
int | GetStep () |
void | SetTime (REAL time) |
Sets time will be used in dx files. More... | |
REAL | GetTime () |
Gets time used in dx files. More... | |
void | ShowShape (const std::string &plotfile, TPZVec< int64_t > &equationindices) |
Graphic of the solution as V3DGrap visualization. More... | |
void | ShowShape (const std::string &plotfile, TPZVec< int64_t > &equationindices, int matid, const TPZVec< std::string > &varname) |
Graphic of the solution as V3DGrap visualization. More... | |
void | LoadShape (double dx, double dy, int64_t numelem, TPZConnect *nod) |
Make assembling and clean the load and solution vectors. More... | |
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. More... | |
virtual void | DefineGraphMesh (int dimension, const TPZVec< std::string > &scalnames, const TPZVec< std::string > &vecnames, const TPZVec< std::string > &tensnames, const std::string &plotfile) |
Define GrapMesh as VTK with tensorial names depending on extension of the file. More... | |
virtual void | DefineGraphMesh (int dimension, const std::set< int > &matids, 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. More... | |
virtual void | DefineGraphMesh (int dimension, const std::set< int > &matids, const TPZVec< std::string > &scalnames, const TPZVec< std::string > &vecnames, const TPZVec< std::string > &tensnames, const std::string &plotfile) |
Define GrapMesh as VTK with tensorial names depending on extension of the file. More... | |
virtual void | CloseGraphMesh () |
Clean the GrapMesh vector. More... | |
TPZGraphMesh * | GraphMesh (int dimension) |
Defines the postprocessing parameters for the graphical grid. More... | |
virtual void | PostProcess (int resolution) |
Draw solution over mesh for all dimensions. More... | |
virtual void | PostProcess (int resolution, int dimension) |
Draw solution over mesh by dimension. More... | |
void | IdentifyPostProcessingMatIds (int dimension, std::set< int > &matids) |
Fill mat ids with materials with provided dimension wich are not boundary conditinos or interface. More... | |
virtual void | LoadSolution () |
Load the solution into the computable grid. More... | |
virtual void | LoadSolution (const TPZFMatrix< STATE > &sol) |
Load the solution into the computable mesh considering sol as Solution vector of the analysis. More... | |
TPZVec< STATE > | Integrate (const std::string &varname, const std::set< int > &matids) |
Integrate the postprocessed variable name over the elements included in the set matids. More... | |
void | SetExact (std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &result, TPZFMatrix< STATE > &deriv)> f) |
Sets the pointer of the exact solution function. More... | |
virtual void | PostProcess (TPZVec< REAL > &loc, std::ostream &out=std::cout) |
Compute the local error over all elements and global errors in several norms and print out. More... | |
virtual void | PostProcessError (TPZVec< REAL > &, bool store_error=true, std::ostream &out=std::cout) |
Compute the local error over all elements and global errors in several norms and print out without calculating the errors of the variables for hdiv spaces. More... | |
virtual void | PostProcessErrorSerial (TPZVec< REAL > &, bool store_error=true, std::ostream &out=std::cout) |
virtual void | PostProcessErrorParallel (TPZVec< REAL > &, bool store_error=true, std::ostream &out=std::cout) |
void | CreateListOfCompElsToComputeError (TPZAdmChunkVector< TPZCompEl *> &elvec) |
void | Print (const std::string &name, std::ostream &out) |
Print connect and solution information. More... | |
void | PrintVectorByElement (std::ostream &out, TPZFMatrix< STATE > &vec, REAL tol=1.e-10) |
Print the residual vector for those elements with entry above a given tolerance. More... | |
TPZMatrixSolver< STATE > & | Solver () |
Get the solver matrix. More... | |
void | AnimateRun (int64_t num_iter, int steps, TPZVec< std::string > &scalnames, TPZVec< std::string > &vecnames, const std::string &plotfile) |
Run and print the solution step by step. More... | |
void | SetSolver (TPZMatrixSolver< STATE > &solver) |
Set solver matrix. More... | |
void | SetStructuralMatrix (TPZAutoPointer< TPZStructMatrix > strmatrix) |
Set structural matrix as auto pointer for analysis. More... | |
void | SetStructuralMatrix (TPZStructMatrix &strmatrix) |
Set structural matrix for analysis. More... | |
int | ClassId () const override |
Define the class id associated with the class. More... | |
virtual void | DefineElementTable (int dimension, TPZVec< int64_t > &GeoElIds, TPZVec< REAL > &points) |
Fill the computational element vector to post processing depending over geometric mesh defined. More... | |
virtual void | SetTableVariableNames (TPZVec< std::string > varnames) |
Sets the names of the variables into the data structure for post processing. More... | |
virtual void | PrePostProcessTable (std::ostream &out_file) |
Prepare data to print post processing and print coordinates. More... | |
virtual void | PostProcessTable (std::ostream &out_file) |
Print the solution related with the computational element vector in post process. More... | |
void | PostProcessTable (TPZFMatrix< REAL > &pos, std::ostream &out=std::cout) |
Compute and print the local error over all elements in data structure of post process, also compute global errors in several norms. 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 | |
TPZFlowCompMesh * | fFlowCompMesh |
Stores a pointer to the computational flow mesh. More... | |
TPZFMatrix< STATE > | fRhsLast |
Vector to hold the contribution of last state to the rhs. More... | |
REAL | fNewtonEps |
Stop criteria for the Newton loops. More... | |
int | fNewtonMaxIter |
Maxime iterations for iterative Newton loops. More... | |
REAL | fTimeIntEps |
Stop criteria for time integration loops. More... | |
int | fTimeIntMaxIter |
Maxime iterations for iterative time integration loops. More... | |
int | fEvolCFL |
Indicates whether the CFL is to evolute or not. More... | |
TPZBlockDiagonal< STATE > * | fpBlockDiag |
Preconditioner. More... | |
int | fTotalNewton |
Total number of newton iterations during this run. More... | |
int | fHasFrontalPreconditioner |
Indication if a frontal matrix is being used as a preconditioner. More... | |
Protected Attributes inherited from TPZAnalysis | |
TPZGeoMesh * | fGeoMesh |
Geometric Mesh. More... | |
TPZCompMesh * | fCompMesh |
Computational mesh. More... | |
TPZGraphMesh * | fGraphMesh [3] |
Graphical mesh. More... | |
TPZFMatrix< STATE > | fRhs |
Load vector. More... | |
TPZFMatrix< STATE > | fSolution |
Solution vector. More... | |
TPZMatrixSolver< STATE > * | fSolver |
Type of solver to be applied. More... | |
TPZVec< std::string > | fScalarNames [3] |
Scalar variables names - to post process. More... | |
TPZVec< std::string > | fVectorNames [3] |
Vectorial variables names - to post process. More... | |
TPZVec< std::string > | fTensorNames [3] |
Tensorial variables names - to post process. More... | |
int | fStep |
Time step. More... | |
REAL | fTime |
Time variable which is used in dx output. More... | |
int | fNthreadsError |
Number of threads to be used for post-processing error. More... | |
TPZAutoPointer< TPZStructMatrix > | fStructMatrix |
Structural matrix. More... | |
TPZAutoPointer< TPZRenumbering > | fRenumber |
Renumbering scheme. More... | |
TPZAutoPointer< TPZGuiInterface > | fGuiInterface |
Pointer for gui interface object. More... | |
TTablePostProcess | fTable |
Additional Inherited Members | |
Public Types inherited from TPZAnalysis | |
enum | EPrecond { EJacobi, EBlockJacobi, EElement, ENodeCentered } |
Preconditioners which can be created by objects of this class. More... | |
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 TPZSavable * | CreateInstance (const int &classId) |
Public Attributes inherited from TPZAnalysis | |
std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &result, TPZFMatrix< STATE > &deriv)> | fExact |
Pointer to Exact solution function, it is necessary to calculating errors. More... | |
Implements an analysis procedure for computing the steady state solution of a compressible Euler flow simulation. Analysis.
Definition at line 34 of file pzeuleranalysis.h.
TPZEulerAnalysis::TPZEulerAnalysis | ( | ) |
Default constructor.
Definition at line 28 of file pzeuleranalysis.cpp.
TPZEulerAnalysis::TPZEulerAnalysis | ( | TPZFlowCompMesh * | mesh, |
std::ostream & | out = std::cout |
||
) |
Constructor over computational mesh. out is not used.
Definition at line 38 of file pzeuleranalysis.cpp.
TPZEulerAnalysis::~TPZEulerAnalysis | ( | ) |
Simple destructor.
Definition at line 48 of file pzeuleranalysis.cpp.
|
virtual |
Assembles the stiffness matrix.
BufferLastStateAssemble or UpdateHistory must be called first.
Reimplemented from TPZAnalysis.
Definition at line 156 of file pzeuleranalysis.cpp.
References TPZBlockDiagonal< TVar >::BuildFromMatrix(), DebugStop, TPZAnalysis::fCompMesh, fpBlockDiag, TPZAnalysis::fRhs, fRhsLast, TPZAnalysis::fSolver, TPZAnalysis::fStructMatrix, TPZMatrixSolver< TVar >::Matrix(), PZError, TPZMatrixSolver< TVar >::SetMatrix(), and TPZBlockDiagonal< TVar >::Zero().
Referenced by Run(), and RunNewton().
|
virtual |
Assembles the right hand side vector.
BufferLastStateAssemble or UpdateHistory must be called first.
Definition at line 214 of file pzeuleranalysis.cpp.
References TPZAnalysis::fCompMesh, TPZAnalysis::fRhs, fRhsLast, and TPZAnalysis::fStructMatrix.
Referenced by LineSearch(), Run(), and UpdateSolAndRhs().
void TPZEulerAnalysis::BufferLastStateAssemble | ( | ) |
Buffers the assemblage of the rhs with respect to the last state.
Sets the current solution in the mesh when finished.
Definition at line 122 of file pzeuleranalysis.cpp.
References TPZAnalysis::fCompMesh, fRhsLast, TPZAnalysis::fStructMatrix, TPZCompMesh::NEquations(), TPZFMatrix< TVar >::Redim(), SetAdvancedState(), SetLastState(), UpdateHistory(), and TPZFMatrix< TVar >::Zero().
Referenced by Run().
void TPZEulerAnalysis::CFLControl | ( | REAL & | lastEpsilon, |
REAL & | epsilon, | ||
REAL & | epsilon_Newton, | ||
REAL & | timeStep | ||
) |
Evaluates the CFL control based on the newest residual norm (epsilon) and last residual norm (lastEpsilon).
lastEpsilon | [in/out] norm of the last flux vector, it is set to epsilon after CFL update. |
epsilon | [in] norm of the current flux vector. |
epsilon_Newton | [in] residual of the nonlinear invertion. |
timeStep | [in/out] parameter to accumulate the same scales.Scales are also applied to timeStep |
Definition at line 455 of file pzeuleranalysis.cpp.
References fEvolCFL, fFlowCompMesh, fNewtonEps, and TPZFlowCompMesh::ScaleCFL().
void TPZEulerAnalysis::CompareRhs | ( | ) |
Trying difference between two times.
Definition at line 577 of file pzeuleranalysis.cpp.
References TPZCompEl::CalcResidual(), TPZCompEl::CalcStiff(), TPZElementMatrix::EF, TPZElementMatrix::EK, TPZCompMesh::ElementVec(), TPZAnalysis::fCompMesh, TPZElementMatrix::fMat, and TPZCompMesh::NElements().
Referenced by Solve().
REAL TPZEulerAnalysis::ComputeTimeStep | ( | ) |
Defines the time step for each material in the mesh.
Definition at line 481 of file pzeuleranalysis.cpp.
References TPZFlowCompMesh::ComputeTimeStep(), and fFlowCompMesh.
REAL TPZEulerAnalysis::EvaluateFluxEpsilon | ( | ) |
Evaluates the flux part of the residual for convergence check.
Definition at line 133 of file pzeuleranalysis.cpp.
References TPZAnalysis::fCompMesh, fFlowCompMesh, Flux_RT, TPZAnalysis::fStructMatrix, TPZCompMesh::NEquations(), Norm(), TPZFMatrix< TVar >::Redim(), Residual_RT, SetAdvancedState(), SetLastState(), TPZFlowCompMesh::SetResidualType(), and TPZFMatrix< TVar >::Zero().
Referenced by Run().
int TPZEulerAnalysis::LineSearch | ( | REAL & | residual, |
TPZFMatrix< STATE > & | sol0, | ||
TPZFMatrix< STATE > & | dir | ||
) |
This method will search for the solution which minimizes the residual.
residual | [in/out] initial residual (of sol0) and on exiting final residual |
sol0 | [in/out] solution vector |
dir | [in] search direction |
Definition at line 517 of file pzeuleranalysis.cpp.
References AssembleRhs(), dist(), error(), fabs, fFlowCompMesh, TPZAnalysis::fRhs, TPZCompMesh::LoadSolution(), Norm(), and test::obj.
Referenced by Solve(), and UpdateSolAndRhs().
TPZDXGraphMesh * TPZEulerAnalysis::PrepareDXMesh | ( | const std::string & | dxout, |
int | dxRes | ||
) |
Prepares the DX graph mesh.
Definition at line 306 of file pzeuleranalysis.cpp.
References DebugStop, TPZMaterial::Dimension(), TPZDXGraphMesh::DrawMesh(), fFlowCompMesh, TPZFlowCompMesh::GetFlowMaterial(), TPZMaterial::Id(), TPZAnalysis::Mesh(), TPZDXGraphMesh::SetFileName(), and TPZGraphMesh::SetResolution().
|
virtual |
See declaration in the base class.
Definition at line 335 of file pzeuleranalysis.cpp.
References BufferLastStateAssemble(), CFLControl(), ComputeTimeStep(), TPZDXGraphMesh::DrawSolution(), EvaluateFluxEpsilon(), fFlowCompMesh, TPZAnalysis::fSolution, TPZAnalysis::fSolver, fTimeIntEps, fTotalNewton, LOGPZ_DEBUG, TPZGraphMesh::Out(), PrepareDXMesh(), TPZMatrixSolver< TVar >::ResetMatrix(), RunNewton(), TPZFlowCompMesh::SetFlowforcingFunction(), UpdateHistory(), and TPZFMatrix< TVar >::Zero().
|
inlinevirtual |
See declaration in the base class.
Reimplemented from TPZAnalysis.
Definition at line 52 of file pzeuleranalysis.h.
References Assemble(), AssembleRhs(), BufferLastStateAssemble(), EvaluateFluxEpsilon(), test::res, TPZAnalysis::Run(), SetAdvancedState(), SetContributionTime(), SetEvolCFL(), SetLastState(), Solve(), UpdateHistory(), and UpdateSolAndRhs().
int TPZEulerAnalysis::RunNewton | ( | REAL & | epsilon, |
int & | numIter | ||
) |
Implements the Newton's method.
epsilon | [in/out] expected tolerance in the Newton's method. Returns the value of the achieved tolerance. |
numIter | [in/out] maximal number of iterations of the Newton's method. |
Definition at line 246 of file pzeuleranalysis.cpp.
References Assemble(), TPZFrontStructMatrix< front >::CreateAssemble(), ELU, fHasFrontalPreconditioner, fNewtonEps, TPZAnalysis::fRhs, TPZAnalysis::fSolver, fTotalNewton, LOGPZ_DEBUG, TPZAnalysis::Mesh(), Norm(), test::res, TPZMatrix< TVar >::Rows(), TPZStepSolver< TVar >::SetDirect(), TPZMatrixSolver< TVar >::SetMatrix(), TPZStepSolver< TVar >::SetPreconditioner(), TPZFrontStructMatrix< front >::SetQuiet(), Solve(), and UpdateSolAndRhs().
void TPZEulerAnalysis::SetAdvancedState | ( | ) |
Sets the solution vector to be the one representing the Advanced State (Wn+1) or the advanced implicit solution.
Definition at line 52 of file pzeuleranalysis.cpp.
References Advanced_CT, TPZAnalysis::fCompMesh, TPZAnalysis::fSolution, TPZCompMesh::LoadSolution(), and SetContributionTime().
Referenced by BufferLastStateAssemble(), EvaluateFluxEpsilon(), and Run().
void TPZEulerAnalysis::SetBlockDiagonalPrecond | ( | TPZBlockDiagonal< STATE > * | blockDiag | ) |
Informs a block diagonal to be used as preconditioning.
Definition at line 503 of file pzeuleranalysis.cpp.
References fpBlockDiag.
Referenced by SetGMResBlock(), and Solve().
void TPZEulerAnalysis::SetContributionTime | ( | TPZContributeTime | time | ) |
Informs the Analysis class 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 64 of file pzeuleranalysis.cpp.
References fFlowCompMesh, and TPZFlowCompMesh::SetContributionTime().
Referenced by Run(), SetAdvancedState(), and SetLastState().
void TPZEulerAnalysis::SetEvolCFL | ( | int | EvolCFL | ) |
Indicates whether the CFL is to evolute or not.
Definition at line 498 of file pzeuleranalysis.cpp.
References fEvolCFL.
Referenced by Run().
void TPZEulerAnalysis::SetFrontalSolver | ( | ) |
Set to solve with Frontal method.
Definition at line 635 of file pzeuleranalysis.cpp.
References ELU, fHasFrontalPreconditioner, TPZAnalysis::Mesh(), TPZStepSolver< TVar >::SetDirect(), TPZFrontStructMatrix< front >::SetQuiet(), TPZAnalysis::SetSolver(), and TPZAnalysis::SetStructuralMatrix().
Referenced by Solve().
void TPZEulerAnalysis::SetGMResBlock | ( | REAL | tol, |
int | numiter, | ||
int | numvec | ||
) |
Set to solve with GMRes algorithm for block diagonal matrix.
Definition at line 652 of file pzeuleranalysis.cpp.
References TPZBlockDiagonalStructMatrix::AssembleBlockDiagonal(), TPZSpStructMatrix::Create(), ELU, fHasFrontalPreconditioner, TPZAnalysis::Mesh(), SetBlockDiagonalPrecond(), TPZStepSolver< TVar >::SetDirect(), TPZStepSolver< TVar >::SetGMRES(), TPZMatrixSolver< TVar >::SetMatrix(), TPZAnalysis::SetSolver(), TPZAnalysis::SetStructuralMatrix(), and TPZAnalysis::Solver().
Referenced by Solve().
void TPZEulerAnalysis::SetGMResFront | ( | REAL | tol, |
int | numiter, | ||
int | numvectors | ||
) |
Set to solve with GMRes algorithm.
Definition at line 603 of file pzeuleranalysis.cpp.
References TPZSpStructMatrix::Create(), TPZFrontStructMatrix< front >::CreateAssemble(), ELU, fHasFrontalPreconditioner, TPZAnalysis::fRhs, TPZAnalysis::Mesh(), TPZStepSolver< TVar >::SetDirect(), TPZStepSolver< TVar >::SetGMRES(), TPZMatrixSolver< TVar >::SetMatrix(), TPZFrontStructMatrix< front >::SetQuiet(), TPZAnalysis::SetSolver(), TPZAnalysis::SetStructuralMatrix(), and TPZAnalysis::Solver().
Referenced by Solve().
void TPZEulerAnalysis::SetLastState | ( | ) |
Sets the solution vector to be the one representing the Current State (Wn) or the last explicit solution.
Definition at line 58 of file pzeuleranalysis.cpp.
References TPZAnalysis::fCompMesh, TPZAnalysis::fSolution, Last_CT, TPZCompMesh::LoadSolution(), and SetContributionTime().
Referenced by BufferLastStateAssemble(), EvaluateFluxEpsilon(), and Run().
void TPZEulerAnalysis::SetNewtonCriteria | ( | REAL | epsilon, |
int | maxIter | ||
) |
Settings for the Newton's method.
Definition at line 486 of file pzeuleranalysis.cpp.
References fNewtonEps, and fNewtonMaxIter.
Referenced by Solve().
void TPZEulerAnalysis::SetTimeIntCriteria | ( | REAL | epsilon, |
int | maxIter | ||
) |
Settings for the time integration method.
Definition at line 492 of file pzeuleranalysis.cpp.
References fTimeIntEps, and fTimeIntMaxIter.
Referenced by Solve().
int TPZEulerAnalysis::Solve | ( | REAL & | res, |
TPZFMatrix< STATE > * | residual, | ||
TPZFMatrix< STATE > & | delSol | ||
) |
Solves an assembled stiffness matrix.
res | [out] residual of the linear system solution |
residual | [in] pointer to a temporary matrix storage |
delSol | [out] returns the delta Solution vector. |
Definition at line 230 of file pzeuleranalysis.cpp.
References TPZAnalysis::fCompMesh, TPZAnalysis::fRhs, TPZAnalysis::fSolver, TPZCompMesh::NEquations(), TPZFMatrix< TVar >::Redim(), TPZMatrix< TVar >::Rows(), and TPZSolver< TVar >::Solve().
|
inlinevirtual |
Invert the stiffness matrix.
Reimplemented from TPZAnalysis.
Definition at line 130 of file pzeuleranalysis.h.
References CFLControl(), CompareRhs(), ComputeTimeStep(), LineSearch(), PrepareDXMesh(), RunNewton(), SetBlockDiagonalPrecond(), SetFrontalSolver(), SetGMResBlock(), SetGMResFront(), SetNewtonCriteria(), SetTimeIntCriteria(), TPZAnalysis::Solve(), and pzgeom::tol.
Referenced by Run(), and RunNewton().
void TPZEulerAnalysis::UpdateHistory | ( | ) |
After a call to UpdateSolution, this method shifts the history in one solution, so that the current solution in the last iteration becomes the last solution in the newest iteration.
This method does not reset the current solution.
To reset it, UpdateSolution with a deltaSol containing any valid value (zeros, for instance) must be called.
Definition at line 109 of file pzeuleranalysis.cpp.
References TPZAnalysis::fSolution, and TPZFMatrix< TVar >::Zero().
Referenced by BufferLastStateAssemble(), and Run().
void TPZEulerAnalysis::UpdateSolAndRhs | ( | TPZFMatrix< STATE > & | deltaSol, |
REAL & | epsilon | ||
) |
Adds deltaSol to the last solution and stores it as the current solution, preparing it to contribute again.
deltaSol | [in] result of previous call to Solve. |
epsilon | [out] norm of resultant fRhs. Also updates the CompMesh soution. |
Definition at line 69 of file pzeuleranalysis.cpp.
References AssembleRhs(), TPZAnalysis::fCompMesh, fFlowCompMesh, TPZAnalysis::fRhs, TPZAnalysis::fSolution, LineSearch(), TPZCompMesh::LoadSolution(), Norm(), test::obj, and TPZFlowCompMesh::ScaleCFL().
Referenced by Run(), and RunNewton().
void TPZEulerAnalysis::WriteCMesh | ( | const char * | str | ) |
Writes the computational mesh onto disk.
Definition at line 508 of file pzeuleranalysis.cpp.
References fFlowCompMesh, TPZAnalysis::fGeoMesh, TPZFileStream::OpenWrite(), TPZFlowCompMesh::Write(), and TPZGeoMesh::Write().
|
protected |
Indicates whether the CFL is to evolute or not.
Definition at line 212 of file pzeuleranalysis.h.
Referenced by CFLControl(), and SetEvolCFL().
|
protected |
Stores a pointer to the computational flow mesh.
The inherited fCompMesh is also updated with valid values to keep compatibility
with inherited methods, but in this class fFlowCompMesh is used whenever a method exclusive
from this class is needed.
Definition at line 196 of file pzeuleranalysis.h.
Referenced by CFLControl(), ComputeTimeStep(), EvaluateFluxEpsilon(), LineSearch(), PrepareDXMesh(), Run(), SetContributionTime(), UpdateSolAndRhs(), and WriteCMesh().
|
protected |
Indication if a frontal matrix is being used as a preconditioner.
Definition at line 221 of file pzeuleranalysis.h.
Referenced by RunNewton(), SetFrontalSolver(), SetGMResBlock(), and SetGMResFront().
|
protected |
Stop criteria for the Newton loops.
Definition at line 202 of file pzeuleranalysis.h.
Referenced by CFLControl(), RunNewton(), and SetNewtonCriteria().
|
protected |
Maxime iterations for iterative Newton loops.
Definition at line 204 of file pzeuleranalysis.h.
Referenced by SetNewtonCriteria().
|
protected |
Preconditioner.
Definition at line 215 of file pzeuleranalysis.h.
Referenced by Assemble(), and SetBlockDiagonalPrecond().
|
protected |
Vector to hold the contribution of last state to the rhs.
Definition at line 199 of file pzeuleranalysis.h.
Referenced by Assemble(), AssembleRhs(), and BufferLastStateAssemble().
|
protected |
Stop criteria for time integration loops.
Definition at line 207 of file pzeuleranalysis.h.
Referenced by Run(), and SetTimeIntCriteria().
|
protected |
Maxime iterations for iterative time integration loops.
Definition at line 209 of file pzeuleranalysis.h.
Referenced by SetTimeIntCriteria().
|
protected |
Total number of newton iterations during this run.
Definition at line 218 of file pzeuleranalysis.h.
Referenced by Run(), and RunNewton().