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

Base class for all drivers. More...

#include <CDriverBase.hpp>

Inheritance diagram for CDriverBase:
[legend]

Public Member Functions

 CDriverBase (char *confFile, unsigned short val_nZone, SU2_Comm MPICommunicator)
 Constructor of the class.
 
virtual ~CDriverBase (void)
 Destructor of the class.
 
virtual void Run ()
 A virtual member.
 
virtual void Finalize ()
 A virtual member.
 
vector< string > GetOutputNames () const
 Get the list of available outputs.
 
passivedouble GetOutputValue (const std::string &output_name) const
 Get the value of one of the available history outputs.
 
vector< string > GetMarkerOutputNames () const
 Get the list of available surface outputs on both MARKER_MONITORING and MARKER_ANALYZE.
 
passivedouble GetMarkerMonitoringOutputValue (const std::string &output_name, const std::string &marker_monitoring) const
 Get the value of one of the available surface outputs at a given MARKER_MONITORING.
 
passivedouble GetMarkerAnalyzeOutputValue (const std::string &output_name, const std::string &marker_analyze) const
 Get the value of one of the available surface outputs at a given MARKER_ANALYZE.
 
unsigned short GetNumberDesignVariables () const
 Get the number of design variables.
 
unsigned short GetNumberFFDBoxes () const
 Get the number of FFD boxes.
 
unsigned long GetNumberDimensions () const
 Get the number of dimensions of the mesh.
 
unsigned long GetNumberElements () const
 Get the number of elements in the mesh.
 
unsigned long GetElementGlobalIndex (unsigned long iElem) const
 Get the global index of a mesh element.
 
vector< unsigned long > GetElementNodes (unsigned long iElem) const
 Get the node indices of a mesh element.
 
unsigned long GetNumberNodes () const
 Get the number of nodes in the mesh (including halos).
 
unsigned long GetNumberHaloNodes () const
 Get the number of halo nodes in the mesh.
 
unsigned long GetNodeGlobalIndex (unsigned long iPoint) const
 Get the global node index.
 
bool GetNodeDomain (unsigned long iPoint) const
 Get the halo flag of a mesh node.
 
CPyWrapperMatrixView InitialCoordinates () const
 Get a read-only view of the initial (undeformed) coordinates of all mesh nodes.
 
CPyWrapperMarkerMatrixView MarkerInitialCoordinates (unsigned short iMarker) const
 Get a read-only view of the initial (undeformed) coordinates of the mesh nodes of a marker.
 
CPyWrapperMatrixView Coordinates ()
 Get a read/write view of the current coordinates of all mesh nodes.
 
CPyWrapperMarkerMatrixView MarkerCoordinates (unsigned short iMarker)
 Get a read/write view of the current coordinates of the mesh nodes of a marker.
 
unsigned short GetNumberMarkers () const
 Get the number of markers in the mesh.
 
map< string, unsigned short > GetMarkerIndices () const
 Get all the boundary markers tags with their associated indices.
 
map< string, string > GetMarkerTypes () const
 Get all the boundary markers tags with their associated types.
 
vector< string > GetMarkerTags () const
 Get all the boundary marker tags.
 
vector< string > GetDeformableMarkerTags () const
 Get all the deformable boundary marker tags.
 
vector< string > GetCHTMarkerTags () const
 Get all the CHT boundary marker tags.
 
vector< string > GetInletMarkerTags () const
 Get all the inlet boundary marker tags.
 
unsigned long GetNumberMarkerElements (unsigned short iMarker) const
 Get the number of elements in the marker.
 
unsigned long GetMarkerElementGlobalIndex (unsigned short iMarker, unsigned long iElem) const
 Get the global index of a marker element.
 
vector< unsigned long > GetMarkerElementNodes (unsigned short iMarker, unsigned long iElem) const
 Get the node indices of a marker element.
 
unsigned long GetNumberMarkerNodes (unsigned short iMarker) const
 Get the number of nodes in the marker.
 
unsigned long GetMarkerNode (unsigned short iMarker, unsigned long iVertex) const
 Get the node index of a marker.
 
vector< passivedouble > GetMarkerVertexNormals (unsigned short iMarker, unsigned long iVertex, bool normalize=false) const
 Get the normal vector of a marker vertex.
 
vector< passivedouble > GetMarkerDisplacement (unsigned short iMarker, unsigned long iVertex) const
 Get the displacements currently imposed of a marker vertex.
 
void SetMarkerCustomDisplacement (unsigned short iMarker, unsigned long iVertex, vector< passivedouble > values)
 Set the mesh displacements of a marker vertex.
 
vector< passivedouble > GetMarkerMeshVelocity (unsigned short iMarker, unsigned long iVertex) const
 Get the mesh velocities currently imposed on a marker vertex.
 
void SetMarkerCustomMeshVelocity (unsigned short iMarker, unsigned long iVertex, vector< passivedouble > values)
 Set the velocities of a marker vertex.
 
void CommunicateMeshDisplacements (void)
 Communicate the boundary mesh displacements.
 
map< string, unsigned short > GetSolverIndices () const
 Get all the active solver names with their associated indices (which can be used to access their data).
 
map< string, unsigned short > GetFEASolutionIndices () const
 Get the structural solver solution variable names with their associated indices. These correspond to the column indices in the matrix returned by e.g. Solution().
 
CPyWrapperMatrixView Solution (unsigned short iSolver)
 Get a read/write view of the current solution on all mesh nodes of a solver.
 
CPyWrapper3DMatrixView Gradient (unsigned short iSolver)
 Get read/write view of the gradients of a solver variable in a point.
 
CPyWrapperMatrixView UserDefinedSource (unsigned short iSolver)
 Get a read/write view of the user defined source on all mesh nodes of a solver.
 
CPyWrapperMarkerMatrixView MarkerSolution (unsigned short iSolver, unsigned short iMarker)
 Get a read/write view of the current solution on the mesh nodes of a marker.
 
CPyWrapperMatrixView SolutionTimeN (unsigned short iSolver)
 Get a read/write view of the solution at time N on all mesh nodes of a solver.
 
CPyWrapperMarkerMatrixView MarkerSolutionTimeN (unsigned short iSolver, unsigned short iMarker)
 Get a read/write view of the solution at time N on the mesh nodes of a marker.
 
CPyWrapperMatrixView SolutionTimeN1 (unsigned short iSolver)
 Get a read/write view of the solution at time N-1 on all mesh nodes of a solver.
 
CPyWrapperMarkerMatrixView MarkerSolutionTimeN1 (unsigned short iSolver, unsigned short iMarker)
 Get a read/write view of the solution at time N-1 on the mesh nodes of a marker.
 
map< string, unsigned short > GetPrimitiveIndices () const
 Get the flow solver primitive variable names with their associated indices. These correspond to the column indices in the matrix returned by Primitives.
 
CPyWrapperMatrixView Primitives ()
 Get a read/write view of the current primitive variables on all mesh nodes of the flow solver.
 
CPyWrapperMarkerMatrixView MarkerPrimitives (unsigned short iMarker)
 Get a read/write view of the current primitive variables on the mesh nodes of a marker.
 
CPyWrapperMatrixView Sensitivity (unsigned short iSolver)
 Get a read-only view of the geometry sensitivity of a discrete adjoint solver.
 
void SetMarkerCustomTemperature (unsigned short iMarker, unsigned long iVertex, passivedouble WallTemp)
 Set the temperature of a vertex on a specified marker (MARKER_PYTHON_CUSTOM).
 
void SetMarkerCustomNormalHeatFlux (unsigned short iMarker, unsigned long iVertex, passivedouble WallHeatFlux)
 Set the wall normal heat flux at a vertex on a specified marker (MARKER_PYTHON_CUSTOM).
 
void SetMarkerCustomScalar (unsigned short iMarker, unsigned long iVertex, vector< passivedouble > WallScalar)
 Set the wall normal scalar values at a vertex on a specified marker (MARKER_PYTHON_CUSTOM).
 
void SelectZone (unsigned short iZone)
 Selects zone to be used for python driver operations.
 
unsigned short SelectedZone () const
 Returns the index of the zone selected for python driver operations.
 
passivedouble GetMarkerNormalHeatFlux (unsigned short iSolver, unsigned short iMarker, unsigned long iVertex) const
 Get the wall normal heat flux at a vertex on a specified marker of the flow or heat solver.
 
void SetMarkerCustomFEALoad (unsigned short iMarker, unsigned long iVertex, std::vector< passivedouble > force)
 Sets the nodal force for the structural solver at a vertex of a marker.
 
vector< passivedouble > GetMarkerFlowLoad (unsigned short iMarker, unsigned long iVertex) const
 Get the fluid force at a vertex of a solid wall marker of the flow solver.
 
void SetMarkerCustomFlowLoadAdjoint (unsigned short iMarker, unsigned long iVertex, vector< passivedouble > adjointLoad)
 Set the adjoint of the flow tractions of the flow solver.
 
vector< passivedouble > GetMarkerDisplacementSensitivity (unsigned short iMarker, unsigned long iVertex) const
 Get the sensitivities of the displacements of the mesh boundary vertices.
 
vector< passivedouble > GetMarkerFEALoadSensitivity (unsigned short iMarker, unsigned long iVertex) const
 Get the sensitivity of the FEA loads of the structural solver (via the adjoint structural solver).
 
void SetMarkerCustomFEADisplacementAdjoint (unsigned short iMarker, unsigned long iVertex, vector< passivedouble > adjointDisplacement)
 Set the adjoint of the structural displacements.
 
void SetMarkerCustomFEAVelocityAdjoint (unsigned short iMarker, unsigned long iVertex, vector< passivedouble > adjointVelocity)
 Set the adjoint of the structural velocities.
 
void SetMarkerCustomInletFlowVar0 (unsigned short iMarker, unsigned long iVertex, passivedouble value)
 Set the first variable in MARKER_INLET (usually temperature).
 
void SetMarkerCustomInletFlowVar1 (unsigned short iMarker, unsigned long iVertex, passivedouble value)
 Set the second variable in MARKER_INLET (usually total pressure).
 
void SetMarkerCustomInletFlowDirection (unsigned short iMarker, unsigned long iVertex, std::vector< passivedouble > values)
 Set the flow direction vector (does not need to be a unit vector).
 

Protected Member Functions

CSolver * GetSolverAndCheckMarker (unsigned short iSolver, unsigned short iMarker=std::numeric_limits< unsigned short >::max()) const
 Automates some boilerplate of accessing solution fields for the python wrapper.
 
void InitializeContainers ()
 Initialize containers.
 
void CommonFinalize ()
 Delete containers.
 
void InputPreprocessing (CConfig **&config, CConfig *&driver_config)
 Read in the config and mesh files.
 
void InitializeGeometry (CConfig *config, CGeometry **&geometry, bool dummy)
 Construction of the edge-based data structure and the multi-grid structure.
 
void InitializeSolver (CConfig *config, CGeometry **geometry, CSolver ***&solver)
 Definition and allocation of all solution classes.
 
void InitializeNumerics (CConfig *config, CGeometry **geometry, CSolver ***solver, CNumerics ****&numerics) const
 Definition and allocation of all solver classes.
 
void OutputPreprocessing (CConfig **config, CConfig *driver_config, COutput **&output_container, COutput *&driver_output)
 Preprocess the output container.
 

Protected Attributes

int rank
 MPI Rank.
 
int size
 MPI Size.
 
char * config_file_name
 Configuration file name of the problem.
 
su2double StartTime
 Start point of the timer for performance benchmarking.
 
su2double StopTime
 Stop point of the timer for performance benchmarking.
 
su2double UsedTimePreproc
 Elapsed time between Start and Stop point of the timer for tracking preprocessing phase.
 
su2double UsedTimeCompute
 Elapsed time between Start and Stop point of the timer for tracking compute phase.
 
su2double UsedTime
 Elapsed time between Start and Stop point of the timer.
 
unsigned long TimeIter
 
unsigned short selected_zone = ZONE_0
 Selected zone for the driver. Defaults to ZONE_0.
 
unsigned short iMesh
 Iterator on mesh levels.
 
unsigned short iZone
 Iterator on zones.
 
unsigned short nZone
 Total number of zones in the problem.
 
unsigned short nDim
 Number of dimensions.
 
unsigned short iInst
 Iterator on instance levels.
 
unsigned short * nInst
 Total number of instances in the problem (per zone).
 
CConfig * driver_config = nullptr
 Definition of the driver configuration.
 
COutput * driver_output = nullptr
 Definition of the driver output.
 
CConfig ** config_container
 Definition of the particular problem.
 
COutput ** output_container
 Pointer to the COutput class.
 
CGeometry **** geometry_container
 Geometrical definition of the problem.
 
CSolver ***** solver_container
 Container vector with all the solutions.
 
CNumerics ****** numerics_container
 Description of the numerical method (the way in which the equations are solved).
 
CSurfaceMovement ** surface_movement
 Surface movement classes of the problem.
 
CVolumetricMovement *** grid_movement
 Volume grid movement classes of the problem.
 
CConfig * main_config = nullptr
 Reference to base (i.e. ZONE 0) configuration (used in driver API).
 
CGeometry * main_geometry = nullptr
 Reference to base (i.e. ZONE, INST, MESH 0) geometry (used in driver API).
 

Detailed Description

Base class for all drivers.

Author
H. Patel, A. Gastaldi

Constructor & Destructor Documentation

◆ CDriverBase()

CDriverBase::CDriverBase ( char *  confFile,
unsigned short  val_nZone,
SU2_Comm  MPICommunicator 
)

Constructor of the class.

Parameters
[in]confFile- Configuration file name.
[in]val_nZone- Total number of zones.
[in]MPICommunicator- MPI communicator for SU2.

◆ ~CDriverBase()

CDriverBase::~CDriverBase ( void  )
virtualdefault

Destructor of the class.

Member Function Documentation

◆ CommonFinalize()

void CDriverBase::CommonFinalize ( )
protected

Delete containers.

◆ Finalize()

virtual void CDriverBase::Finalize ( )
inlinevirtual

A virtual member.

Reimplemented in CDriver, CDeformationDriver, and CDiscAdjDeformationDriver.

◆ GetSolverAndCheckMarker()

CSolver * CDriverBase::GetSolverAndCheckMarker ( unsigned short  iSolver,
unsigned short  iMarker = std::numeric_limits<unsigned short>::max() 
) const
inlineprotected

Automates some boilerplate of accessing solution fields for the python wrapper.

◆ InitializeContainers()

void CDriverBase::InitializeContainers ( )
protected

Initialize containers.

◆ InitializeGeometry()

void CDriverBase::InitializeGeometry ( CConfig *  config,
CGeometry **&  geometry,
bool  dummy 
)
protected

Construction of the edge-based data structure and the multi-grid structure.

Parameters
[in]config- Definition of the particular problem.
[in]geometry- Geometrical definition of the problem.
[in]dummy- Definition of the dummy driver.

◆ InitializeNumerics()

void CDriverBase::InitializeNumerics ( CConfig *  config,
CGeometry **  geometry,
CSolver ***  solver,
CNumerics ****&  numerics 
) const
protected

Definition and allocation of all solver classes.

Parameters
[in]config- Definition of the particular problem.
[in]geometry- Geometrical definition of the problem.
[in]solver- Container vector with all the solutions.
[in]numerics- Description of the numerical method (the way in which the equations are solved).

◆ InitializeSolver()

void CDriverBase::InitializeSolver ( CConfig *  config,
CGeometry **  geometry,
CSolver ***&  solver 
)
protected

Definition and allocation of all solution classes.

Parameters
[in]config- Definition of the particular problem.
[in]geometry- Geometrical definition of the problem.
[in]solver- Container vector with all the solutions.

◆ InputPreprocessing()

void CDriverBase::InputPreprocessing ( CConfig **&  config,
CConfig *&  driver_config 
)
protected

Read in the config and mesh files.

Parameters
[in]config- Definition of the particular problem.
[in]driver_config- Definition of the driver configuration.

◆ OutputPreprocessing()

void CDriverBase::OutputPreprocessing ( CConfig **  config,
CConfig *  driver_config,
COutput **&  output_container,
COutput *&  driver_output 
)
protected

Preprocess the output container.

Parameters
[in]config- Definition of the particular problem.
[in]driver_config- Definition of the driver configuration.
[in]output_container- Container vector with all the outputs.
[in]driver_output- Definition of the driver output.

◆ Run()

virtual void CDriverBase::Run ( void  )
inlinevirtual

Member Data Documentation

◆ config_container

CConfig** CDriverBase::config_container
protected

Definition of the particular problem.

◆ config_file_name

char* CDriverBase::config_file_name
protected

Configuration file name of the problem.

◆ driver_config

CConfig* CDriverBase::driver_config = nullptr
protected

Definition of the driver configuration.

◆ driver_output

COutput* CDriverBase::driver_output = nullptr
protected

Definition of the driver output.

◆ geometry_container

CGeometry**** CDriverBase::geometry_container
protected

Geometrical definition of the problem.

◆ grid_movement

CVolumetricMovement*** CDriverBase::grid_movement
protected

Volume grid movement classes of the problem.

◆ iInst

unsigned short CDriverBase::iInst
protected

Iterator on instance levels.

◆ iMesh

unsigned short CDriverBase::iMesh
protected

Iterator on mesh levels.

◆ iZone

unsigned short CDriverBase::iZone
protected

Iterator on zones.

◆ main_config

CConfig* CDriverBase::main_config = nullptr
protected

Reference to base (i.e. ZONE 0) configuration (used in driver API).

◆ main_geometry

CGeometry* CDriverBase::main_geometry = nullptr
protected

Reference to base (i.e. ZONE, INST, MESH 0) geometry (used in driver API).

◆ nDim

unsigned short CDriverBase::nDim
protected

Number of dimensions.

◆ nInst

unsigned short * CDriverBase::nInst
protected

Total number of instances in the problem (per zone).

◆ numerics_container

CNumerics****** CDriverBase::numerics_container
protected

Description of the numerical method (the way in which the equations are solved).

◆ nZone

unsigned short CDriverBase::nZone
protected

Total number of zones in the problem.

◆ output_container

COutput** CDriverBase::output_container
protected

Pointer to the COutput class.

◆ rank

int CDriverBase::rank
protected

MPI Rank.

◆ selected_zone

unsigned short CDriverBase::selected_zone = ZONE_0
protected

Selected zone for the driver. Defaults to ZONE_0.

◆ size

int CDriverBase::size
protected

MPI Size.

◆ solver_container

CSolver***** CDriverBase::solver_container
protected

Container vector with all the solutions.

◆ StartTime

su2double CDriverBase::StartTime
protected

Start point of the timer for performance benchmarking.

◆ StopTime

su2double CDriverBase::StopTime
protected

Stop point of the timer for performance benchmarking.

◆ surface_movement

CSurfaceMovement** CDriverBase::surface_movement
protected

Surface movement classes of the problem.

◆ TimeIter

unsigned long CDriverBase::TimeIter
protected

◆ UsedTime

su2double CDriverBase::UsedTime
protected

Elapsed time between Start and Stop point of the timer.

◆ UsedTimeCompute

su2double CDriverBase::UsedTimeCompute
protected

Elapsed time between Start and Stop point of the timer for tracking compute phase.

◆ UsedTimePreproc

su2double CDriverBase::UsedTimePreproc
protected

Elapsed time between Start and Stop point of the timer for tracking preprocessing phase.


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