Documentation 6b54b78464
Loading...
Searching...
No Matches
CVerificationSolution Class Reference

Class for holding verification PDE solutions, e.g., phi = phi(x,y,z,t), used for initial conditions, analytic solutions, manufactured solutions. More...

#include <CVerificationSolution.hpp>

Inheritance diagram for CVerificationSolution:
[legend]

Public Member Functions

 CVerificationSolution (void)
 Constructor of the class.
 
 CVerificationSolution (unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig *config)
 
virtual ~CVerificationSolution (void)
 Destructor of the class.
 
virtual void GetSolution (const su2double *val_coords, const su2double val_t, su2double *val_solution) const
 Get the exact solution at the current position and time.
 
void GetInitialCondition (const su2double *val_coords, su2double *val_solution) const
 Get the exact solution at the current position and t = 0.
 
virtual void GetBCState (const su2double *val_coords, const su2double val_t, su2double *val_solution) const
 Get the boundary conditions state for an exact solution.
 
virtual void GetMMSSourceTerm (const su2double *val_coords, const su2double val_t, su2double *val_source) const
 Get the source term for the manufactured solution (MMS).
 
virtual bool IsManufacturedSolution (void) const
 Whether or not this verification solution is a manufactured solution.
 
virtual bool ExactSolutionKnown (void) const
 Whether or not the exact solution is known for this verification solution.
 
void GetLocalError (const su2double *val_coords, const su2double val_t, const su2double *GetLocalErrorval_solution, su2double *val_error) const
 Get the local error defined as the local solution minus the verification solution.
 
void SetError_RMS (unsigned short val_var, su2double val_error)
 Set the global RMS error for verification cases.
 
void AddError_RMS (unsigned short val_var, su2double val_error)
 Increments the global RMS error for verification cases.
 
su2double GetError_RMS (unsigned short val_var) const
 Get the global RMS error for verification cases.
 
void SetError_Max (unsigned short val_var, su2double val_error, unsigned long val_point)
 Set the global maximum error for verification cases.
 
void AddError_Max (unsigned short val_var, su2double val_error, unsigned long val_point, const su2double *val_coord)
 Increment the global maximum error for verification cases.
 
su2double GetError_Max (unsigned short val_var) const
 Get the global maximum error for verification cases.
 
unsigned long GetError_Point_Max (unsigned short val_var) const
 Get the global index of the node with the max error for verification cases.
 
const su2double * GetError_Point_Max_Coord (unsigned short val_var) const
 Get the coordinates of the node with the max error for verification cases.
 
void SetVerificationError (unsigned long nDOFsGlobal, CConfig *config)
 Calculate the global error metrics for verification cases.
 

Protected Attributes

int rank
 MPI Rank.
 
int size
 MPI Size.
 
unsigned short nDim
 Number of dimension of the problem.
 
unsigned short nVar
 Number of variables of the problem

 
MAIN_SOLVER Kind_Solver
 The kind of solver we are running.
 

Detailed Description

Class for holding verification PDE solutions, e.g., phi = phi(x,y,z,t), used for initial conditions, analytic solutions, manufactured solutions.

Author
T. Economon, E. van der Weide

Constructor & Destructor Documentation

◆ CVerificationSolution() [1/2]

CVerificationSolution::CVerificationSolution ( void  )

Constructor of the class.

◆ CVerificationSolution() [2/2]

CVerificationSolution::CVerificationSolution ( unsigned short  val_nDim,
unsigned short  val_nvar,
unsigned short  val_iMesh,
CConfig *  config 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]val_nDim- Number of dimensions of the problem.
[in]val_nvar- Number of variables of the problem.
[in]val_iMesh- Multigrid level of the solver.
[in]config- Definition of the particular problem.

◆ ~CVerificationSolution()

CVerificationSolution::~CVerificationSolution ( void  )
virtual

Destructor of the class.

Member Function Documentation

◆ AddError_Max()

void CVerificationSolution::AddError_Max ( unsigned short  val_var,
su2double  val_error,
unsigned long  val_point,
const su2double *  val_coord 
)
inline

Increment the global maximum error for verification cases.

Parameters
[in]val_var- Index of the variable.
[in]val_error- Value of the maximum error to store in the position val_var.
[in]val_point- Value of the point index for the max error.
[in]val_coord- Location (x, y, z) of the max error point.

◆ AddError_RMS()

void CVerificationSolution::AddError_RMS ( unsigned short  val_var,
su2double  val_error 
)
inline

Increments the global RMS error for verification cases.

Parameters
[in]val_var- Index of the variable.
[in]val_error- Value of the RMS error to store in the position val_var.

◆ ExactSolutionKnown()

bool CVerificationSolution::ExactSolutionKnown ( void  ) const
virtual

Whether or not the exact solution is known for this verification solution.

Returns
- True as default value. Overwrite this function if the exact solution is not known.

Reimplemented in CTGVSolution.

◆ GetBCState()

void CVerificationSolution::GetBCState ( const su2double *  val_coords,
const su2double  val_t,
su2double *  val_solution 
) const
virtual

Get the boundary conditions state for an exact solution.

Parameters
[in]val_coords- Cartesian coordinates of the current position.
[in]val_t- Current physical time.
[in]val_solution- Array where the exact solution is stored.

Reimplemented in CIncTGVSolution, CInviscidVortexSolution, CMMSIncEulerSolution, CMMSIncNSSolution, CMMSNSTwoHalfCirclesSolution, CMMSNSTwoHalfSpheresSolution, CMMSNSUnitQuadSolution, CMMSNSUnitQuadSolutionWallBC, CNSUnitQuadSolution, CRinglebSolution, and CUserDefinedSolution.

◆ GetError_Max()

su2double CVerificationSolution::GetError_Max ( unsigned short  val_var) const
inline

Get the global maximum error for verification cases.

Parameters
[in]val_var- Index of the variable.
Returns
Value of global maximum error for the variable in the position val_var.

◆ GetError_Point_Max()

unsigned long CVerificationSolution::GetError_Point_Max ( unsigned short  val_var) const
inline

Get the global index of the node with the max error for verification cases.

Parameters
[in]val_var- Index of the variable.
Returns
Global index of the point with the max error for the variable in the position val_var.

◆ GetError_Point_Max_Coord()

const su2double * CVerificationSolution::GetError_Point_Max_Coord ( unsigned short  val_var) const
inline

Get the coordinates of the node with the max error for verification cases.

Parameters
[in]val_var- Index of the variable.
Returns
Coordinates of the point with the max error for the variable in the position val_var.

◆ GetError_RMS()

su2double CVerificationSolution::GetError_RMS ( unsigned short  val_var) const
inline

Get the global RMS error for verification cases.

Parameters
[in]val_var- Index of the variable.
Returns
Value of global RMS error for the variable in the position val_var.

◆ GetInitialCondition()

void CVerificationSolution::GetInitialCondition ( const su2double *  val_coords,
su2double *  val_solution 
) const

Get the exact solution at the current position and t = 0.

Parameters
[in]val_coords- Cartesian coordinates of the current position.
[in]val_solution- Array where the exact solution is stored.

◆ GetLocalError()

void CVerificationSolution::GetLocalError ( const su2double *  val_coords,
const su2double  val_t,
const su2double *  GetLocalErrorval_solution,
su2double *  val_error 
) const

Get the local error defined as the local solution minus the verification solution.

Parameters
[in]val_coords- Cartesian coordinates of the current position.
[in]val_solution- Array where the exact solution is stored.
[out]val_error- Array where the local error is stored.

◆ GetMMSSourceTerm()

void CVerificationSolution::GetMMSSourceTerm ( const su2double *  val_coords,
const su2double  val_t,
su2double *  val_source 
) const
virtual

Get the source term for the manufactured solution (MMS).

Parameters
[in]val_coords- Cartesian coordinates of the current position.
[in]val_t- Current physical time.
[in]val_solution- Array where the exact solution is stored.

Reimplemented in CMMSIncEulerSolution, CMMSIncNSSolution, CMMSNSTwoHalfCirclesSolution, CMMSNSTwoHalfSpheresSolution, CMMSNSUnitQuadSolution, CMMSNSUnitQuadSolutionWallBC, and CUserDefinedSolution.

◆ GetSolution()

void CVerificationSolution::GetSolution ( const su2double *  val_coords,
const su2double  val_t,
su2double *  val_solution 
) const
virtual

Get the exact solution at the current position and time.

Parameters
[in]val_coords- Cartesian coordinates of the current position.
[in]val_t- Current physical time.
[in]val_solution- Array where the exact solution is stored.

Reimplemented in CIncTGVSolution, CInviscidVortexSolution, CMMSIncEulerSolution, CMMSIncNSSolution, CMMSNSTwoHalfCirclesSolution, CMMSNSTwoHalfSpheresSolution, CMMSNSUnitQuadSolution, CMMSNSUnitQuadSolutionWallBC, CNSUnitQuadSolution, CRinglebSolution, CTGVSolution, and CUserDefinedSolution.

◆ IsManufacturedSolution()

bool CVerificationSolution::IsManufacturedSolution ( void  ) const
virtual

Whether or not this verification solution is a manufactured solution.

Returns
- False as default value. Overwrite this function for a manufactured solution.

Reimplemented in CMMSIncEulerSolution, CMMSIncNSSolution, CMMSNSTwoHalfCirclesSolution, CMMSNSTwoHalfSpheresSolution, CMMSNSUnitQuadSolution, CMMSNSUnitQuadSolutionWallBC, and CUserDefinedSolution.

◆ SetError_Max()

void CVerificationSolution::SetError_Max ( unsigned short  val_var,
su2double  val_error,
unsigned long  val_point 
)
inline

Set the global maximum error for verification cases.

Parameters
[in]val_var- Index of the variable.
[in]val_error- Value of the maximum error to store in the position val_var.

◆ SetError_RMS()

void CVerificationSolution::SetError_RMS ( unsigned short  val_var,
su2double  val_error 
)
inline

Set the global RMS error for verification cases.

Parameters
[in]val_var- Index of the variable.
[in]val_error- Value of the RMS error to store in the position val_var.

◆ SetVerificationError()

void CVerificationSolution::SetVerificationError ( unsigned long  nDOFsGlobal,
CConfig *  config 
)

Calculate the global error metrics for verification cases.

Parameters
[in]nDOFsGlobal- Global number of degrees of freedom for the current problem.
[in]config- Definition of the particular problem.

Member Data Documentation

◆ Kind_Solver

MAIN_SOLVER CVerificationSolution::Kind_Solver
protected

The kind of solver we are running.

◆ nDim

unsigned short CVerificationSolution::nDim
protected

Number of dimension of the problem.

◆ nVar

unsigned short CVerificationSolution::nVar
protected

Number of variables of the problem

◆ rank

int CVerificationSolution::rank
protected

MPI Rank.

◆ size

int CVerificationSolution::size
protected

MPI Size.


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