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

#include <CParallelDataSorter.hpp>

Inheritance diagram for CParallelDataSorter:
[legend]

Public Member Functions

 CParallelDataSorter (CConfig *config, const vector< string > &valFieldNames)
 Constructor.
 
virtual ~CParallelDataSorter ()
 Destructor.
 
virtual void SortOutputData ()
 Sort the output data for each grid node into a linear partitioning across all processors.
 
virtual void SortConnectivity (CConfig *config, CGeometry *geometry, bool val_sort=true)
 Sort the connectivities (volume and surface) into data structures.
 
virtual void SortConnectivity (CConfig *config, CGeometry *geometry, const vector< string > &markerList)
 Sort the connectivities into data structures (only for surface data sorters).
 
unsigned long GetnPoints () const
 Get the number of points the local rank owns.
 
unsigned long GetnLocalPointsBeforeSort () const
 Get the number of points to sort.
 
unsigned long GetnPointsGlobal () const
 Get the global number of points (accumulated from all ranks)
 
unsigned long GetnElem () const
 Get the global of elements (accumulated from all ranks and element types)
 
unsigned long GetnElem (GEO_TYPE type) const
 Get the local number of elements of a specific type that the current rank owns \input type - The type of element, ref GEO_TYPE.
 
unsigned long GetnElemGlobal (GEO_TYPE type) const
 Get the global number of elements of a specific type \input type - The type of element, ref GEO_TYPE.
 
unsigned long GetnElemGlobal () const
 Get the global number of elements.
 
unsigned long GetnConnGlobal () const
 Get the global number entries of the connectivity array.
 
unsigned long GetnConn () const
 Get the local number entries of the connectivity array.
 
unsigned long GetnElemCumulative (unsigned short rank) const
 Get the cumulated number of elements \input rank - the processor rank.
 
unsigned long GetnElemConnCumulative (unsigned short rank) const
 Get the cumulated number of entries of the connectivity array \input rank - the processor rank.
 
unsigned long GetElemConnectivity (GEO_TYPE type, unsigned long iElem, unsigned long iNode) const
 Get the connectivity of specific element. \input type - The type of element, ref GEO_TYPE \input iElem - The element ID \input iNode - The node ID.
 
virtual unsigned long GetNodeBegin (unsigned short rank) const
 Beginning node ID of the linear partition owned by a specific processor. \input rank - the processor rank.
 
unsigned long GetNodeEnd (unsigned short rank) const
 Ending node ID of the linear partition owned by a specific processor.
 
passivedouble GetData (unsigned short iField, unsigned long iPoint) const
 Get the value of the linear partitioned data. \input iField - the output field ID. \input iPoint - the point ID.
 
const passivedouble * GetData () const
 Get the pointer to the sorted linear partitioned data.
 
virtual unsigned long GetGlobalIndex (unsigned long iPoint) const
 Get the global index of a point. \input iPoint - the point ID.
 
virtual unsigned long GetnPointCumulative (unsigned short rank) const
 Get the cumulated number of points \input rank - the processor rank.
 
unsigned long GetnPointLinear (unsigned short rank) const
 Get the linear number of points \input rank - the processor rank.
 
bool GetConnectivitySorted () const
 Check whether the current connectivity is sorted (i.e. if SortConnectivity has been called)
 
void SetUnsortedData (unsigned long iPoint, unsigned short iField, su2double data)
 Set the value of a specific field at a point. PrepareSendBuffers must be called before using this function.
 
passivedouble GetUnsortedData (unsigned long iPoint, unsigned short iField) const
 
virtual unsigned short FindProcessor (unsigned long iPoint) const
 Get the Processor ID a Point belongs to.
 
const vector< string > & GetFieldNames () const
 Get the vector containing the names of the output fields.
 
const vector< string > & GetRequiredFieldNames () const
 Get the vector containing the names of the required output fields.
 
void SetRequiredFieldNames (const vector< string > &req_field_names)
 Set the vector of required output fields.
 
unsigned short GetnDim () const
 Get the spatial dimension.
 
void SetTotalElements ()
 Set the total number of elements after sorting individual element types.
 

Protected Member Functions

void PrepareSendBuffers (std::vector< unsigned long > &globalID)
 Prepare the send buffers by filling them with the global indices. After calling this function, the data buffer for sending can be filled with the ::SetUnsorted_Data() routine.
 

Protected Attributes

const int rank
 The MPI rank.
 
const int size
 The MPI size, aka the number of processors.
 
unsigned long nGlobalPointBeforeSort
 Global number of points without halos before sorting.
 
unsigned long nLocalPointsBeforeSort
 Local number of points without halos before sorting on this proc.
 
int * Conn_Line_Par
 Local connectivity of line elements.
 
int * Conn_Tria_Par
 Local connectivity of triangle elements.
 
int * Conn_Quad_Par
 Local connectivity of quad elements.
 
int * Conn_Tetr_Par
 Local connectivity of tetrahedral elements.
 
int * Conn_Hexa_Par
 Local connectivity of hexahedral elements.
 
int * Conn_Pris_Par
 Local connectivity of prism elements.
 
int * Conn_Pyra_Par
 Local connectivity of pyramid elements.
 
array< unsigned long, N_ELEM_TYPES > nElemPerTypeGlobal
 Global number of elements after sorting on this proc.
 
array< unsigned long, N_ELEM_TYPES > nElemPerType
 Local number of elements after sorting on this proc.
 
struct { 
 
} TypeMap 
 Map that stores the index for each GEO_TYPE type where to find information in the element arrays.
 
unsigned long nPointsGlobal
 Global number of points without halos.
 
unsigned long nElemGlobal
 Global number of elems without halos.
 
unsigned long nConnGlobal
 Global size of the connectivity array.
 
unsigned long nPoints
 Local number of points.
 
unsigned long nElem
 Local number of elements.
 
unsigned long nConn
 Local size of the connectivity array.
 
CLinearPartitioner linearPartitioner
 Linear partitioner based on the global number of points.
 
unsigned short GlobalField_Counter
 Number of output fields.
 
bool connectivitySorted
 Boolean to store information on whether the connectivity is sorted.
 
int * nPoint_Send
 Number of points this processor has to send to other processors.
 
int * nPoint_Recv
 Number of points this processor receives from other processors.
 
int * nElem_Send
 Number of elements this processor has to send to other processors.
 
int * nElem_Cum
 Cumulative number of elements.
 
unsigned long * nElemConn_Send
 Number of element connectivity this processor has to send to other processors.
 
unsigned long * nElemConn_Cum
 Cumulative number of element connectivity entries.
 
unsigned long * Index
 Index each point has in the send buffer.
 
passivedouble * connSend
 Send buffer holding the data that will be send to other processors.
 
passivedouble * dataBuffer
 Buffer holding the sorted, partitioned data as passivedouble types.
 
unsigned long * idSend
 Send buffer holding global indices that will be send to other processors.
 
int nSends
 Number of sends.
 
int nRecvs
 Number of receives.
 
vector< string > fieldNames
 Vector with names of all the output fields.
 
vector< string > requiredFieldNames
 Vector with names of the required output fields that we write to file.
 
unsigned short nDim
 Spatial dimension of the data.
 

Constructor & Destructor Documentation

◆ CParallelDataSorter()

CParallelDataSorter::CParallelDataSorter ( CConfig *  config,
const vector< string > &  valFieldNames 
)

Constructor.

Parameters
[in]config- Pointer to the current config structure
[in]valFieldNames- Vector containing the field names

◆ ~CParallelDataSorter()

CParallelDataSorter::~CParallelDataSorter ( )
virtual

Destructor.

Member Function Documentation

◆ FindProcessor()

virtual unsigned short CParallelDataSorter::FindProcessor ( unsigned long  iPoint) const
inlinevirtual

Get the Processor ID a Point belongs to.

Parameters
[in]iPoint- global renumbered ID of the point
Returns
The rank/processor number.

Reimplemented in CSurfaceFEMDataSorter, and CSurfaceFVMDataSorter.

◆ GetConnectivitySorted()

bool CParallelDataSorter::GetConnectivitySorted ( ) const
inline

Check whether the current connectivity is sorted (i.e. if SortConnectivity has been called)

Returns
<TRUE> if the connectivity is sorted.

◆ GetData() [1/2]

const passivedouble * CParallelDataSorter::GetData ( ) const
inline

Get the pointer to the sorted linear partitioned data.

Returns
Pointer to the sorted data.

◆ GetData() [2/2]

passivedouble CParallelDataSorter::GetData ( unsigned short  iField,
unsigned long  iPoint 
) const
inline

Get the value of the linear partitioned data. \input iField - the output field ID. \input iPoint - the point ID.

Returns
the value of the data field at a point.

◆ GetElemConnectivity()

unsigned long CParallelDataSorter::GetElemConnectivity ( GEO_TYPE  type,
unsigned long  iElem,
unsigned long  iNode 
) const

Get the connectivity of specific element. \input type - The type of element, ref GEO_TYPE \input iElem - The element ID \input iNode - The node ID.

Returns
the connected node.

◆ GetFieldNames()

const vector< string > & CParallelDataSorter::GetFieldNames ( ) const
inline

Get the vector containing the names of the output fields.

Returns
Vector of strings containing the field names

◆ GetGlobalIndex()

virtual unsigned long CParallelDataSorter::GetGlobalIndex ( unsigned long  iPoint) const
inlinevirtual

Get the global index of a point. \input iPoint - the point ID.

Returns
Global index of a specific point.

Reimplemented in CFEMDataSorter, CFVMDataSorter, CSurfaceFEMDataSorter, and CSurfaceFVMDataSorter.

◆ GetnConn()

unsigned long CParallelDataSorter::GetnConn ( ) const
inline

Get the local number entries of the connectivity array.

Returns
local number of entries of the connectivity array

◆ GetnConnGlobal()

unsigned long CParallelDataSorter::GetnConnGlobal ( ) const
inline

Get the global number entries of the connectivity array.

Returns
global number of entries of the connectivity array

◆ GetnDim()

unsigned short CParallelDataSorter::GetnDim ( ) const
inline

Get the spatial dimension.

Returns
The spatial dimension

◆ GetnElem() [1/2]

unsigned long CParallelDataSorter::GetnElem ( ) const
inline

Get the global of elements (accumulated from all ranks and element types)

Returns
Global number elements.

◆ GetnElem() [2/2]

unsigned long CParallelDataSorter::GetnElem ( GEO_TYPE  type) const
inline

Get the local number of elements of a specific type that the current rank owns \input type - The type of element, ref GEO_TYPE.

Returns
Local number of elements of a specific type.

◆ GetnElemConnCumulative()

unsigned long CParallelDataSorter::GetnElemConnCumulative ( unsigned short  rank) const
inline

Get the cumulated number of entries of the connectivity array \input rank - the processor rank.

Returns
The cumulated number of entries of the connectivity array

◆ GetnElemCumulative()

unsigned long CParallelDataSorter::GetnElemCumulative ( unsigned short  rank) const
inline

Get the cumulated number of elements \input rank - the processor rank.

Returns
The cumulated number of elements

◆ GetnElemGlobal() [1/2]

unsigned long CParallelDataSorter::GetnElemGlobal ( ) const
inline

Get the global number of elements.

Returns
global number of elements.

◆ GetnElemGlobal() [2/2]

unsigned long CParallelDataSorter::GetnElemGlobal ( GEO_TYPE  type) const
inline

Get the global number of elements of a specific type \input type - The type of element, ref GEO_TYPE.

Returns
global number of elements of a specific type.

◆ GetnLocalPointsBeforeSort()

unsigned long CParallelDataSorter::GetnLocalPointsBeforeSort ( ) const
inline

Get the number of points to sort.

Returns
local number of points.

◆ GetNodeBegin()

virtual unsigned long CParallelDataSorter::GetNodeBegin ( unsigned short  rank) const
inlinevirtual

Beginning node ID of the linear partition owned by a specific processor. \input rank - the processor rank.

Returns
The beginning node ID.

Reimplemented in CSurfaceFEMDataSorter, and CSurfaceFVMDataSorter.

◆ GetNodeEnd()

unsigned long CParallelDataSorter::GetNodeEnd ( unsigned short  rank) const
inline

Ending node ID of the linear partition owned by a specific processor.

Parameters
rank- the processor rank.
Returns
The ending node ID.

◆ GetnPointCumulative()

virtual unsigned long CParallelDataSorter::GetnPointCumulative ( unsigned short  rank) const
inlinevirtual

Get the cumulated number of points \input rank - the processor rank.

Returns
The cumulated number of points up to certain processor rank.

Reimplemented in CSurfaceFEMDataSorter, and CSurfaceFVMDataSorter.

◆ GetnPointLinear()

unsigned long CParallelDataSorter::GetnPointLinear ( unsigned short  rank) const
inline

Get the linear number of points \input rank - the processor rank.

Returns
The linear number of points up to certain processor rank.

◆ GetnPoints()

unsigned long CParallelDataSorter::GetnPoints ( ) const
inline

Get the number of points the local rank owns.

Returns
local number of points.

◆ GetnPointsGlobal()

unsigned long CParallelDataSorter::GetnPointsGlobal ( ) const
inline

Get the global number of points (accumulated from all ranks)

Returns
Global number of points.

◆ GetRequiredFieldNames()

const vector< string > & CParallelDataSorter::GetRequiredFieldNames ( ) const
inline

Get the vector containing the names of the required output fields.

Returns
Vector of strings containing the required field names

◆ GetUnsortedData()

passivedouble CParallelDataSorter::GetUnsortedData ( unsigned long  iPoint,
unsigned short  iField 
) const
inline

◆ PrepareSendBuffers()

void CParallelDataSorter::PrepareSendBuffers ( std::vector< unsigned long > &  globalID)
protected

Prepare the send buffers by filling them with the global indices. After calling this function, the data buffer for sending can be filled with the ::SetUnsorted_Data() routine.

Parameters
[in]globalID- Vector containing the global indices of the points

◆ SetRequiredFieldNames()

void CParallelDataSorter::SetRequiredFieldNames ( const vector< string > &  req_field_names)
inline

Set the vector of required output fields.

Returns
None.

◆ SetTotalElements()

void CParallelDataSorter::SetTotalElements ( )

Set the total number of elements after sorting individual element types.

◆ SetUnsortedData()

void CParallelDataSorter::SetUnsortedData ( unsigned long  iPoint,
unsigned short  iField,
su2double  data 
)
inline

Set the value of a specific field at a point. PrepareSendBuffers must be called before using this function.

Parameters
[in]iPoint- ID of the point
[in]iField- Index of the field
[in]data- Value of the field

◆ SortConnectivity() [1/2]

virtual void CParallelDataSorter::SortConnectivity ( CConfig *  config,
CGeometry *  geometry,
bool  val_sort = true 
)
inlinevirtual

Sort the connectivities (volume and surface) into data structures.

Parameters
[in]config- Definition of the particular problem.
[in]geometry- Geometrical definition of the problem.
[in]val_sort- boolean controlling whether the elements are sorted or simply loaded by their owning rank.

Reimplemented in CFEMDataSorter, CFVMDataSorter, CSurfaceFEMDataSorter, and CSurfaceFVMDataSorter.

◆ SortConnectivity() [2/2]

virtual void CParallelDataSorter::SortConnectivity ( CConfig *  config,
CGeometry *  geometry,
const vector< string > &  markerList 
)
inlinevirtual

Sort the connectivities into data structures (only for surface data sorters).

Parameters
[in]config- Definition of the particular problem.
[in]geometry- Geometrical definition of the problem.
[in]markerList- A list of marker names that should be sorted.

Reimplemented in CSurfaceFEMDataSorter, and CSurfaceFVMDataSorter.

◆ SortOutputData()

void CParallelDataSorter::SortOutputData ( )
virtual

Sort the output data for each grid node into a linear partitioning across all processors.

Reimplemented in CSurfaceFEMDataSorter, and CSurfaceFVMDataSorter.

Member Data Documentation

◆ Conn_Hexa_Par

int* CParallelDataSorter::Conn_Hexa_Par
protected

Local connectivity of hexahedral elements.

◆ Conn_Line_Par

int* CParallelDataSorter::Conn_Line_Par
protected

Local connectivity of line elements.

◆ Conn_Pris_Par

int* CParallelDataSorter::Conn_Pris_Par
protected

Local connectivity of prism elements.

◆ Conn_Pyra_Par

int* CParallelDataSorter::Conn_Pyra_Par
protected

Local connectivity of pyramid elements.

◆ Conn_Quad_Par

int* CParallelDataSorter::Conn_Quad_Par
protected

Local connectivity of quad elements.

◆ Conn_Tetr_Par

int* CParallelDataSorter::Conn_Tetr_Par
protected

Local connectivity of tetrahedral elements.

◆ Conn_Tria_Par

int* CParallelDataSorter::Conn_Tria_Par
protected

Local connectivity of triangle elements.

◆ connectivitySorted

bool CParallelDataSorter::connectivitySorted
protected

Boolean to store information on whether the connectivity is sorted.

◆ connSend

passivedouble* CParallelDataSorter::connSend
protected

Send buffer holding the data that will be send to other processors.

◆ dataBuffer

passivedouble* CParallelDataSorter::dataBuffer
protected

Buffer holding the sorted, partitioned data as passivedouble types.

◆ fieldNames

vector<string> CParallelDataSorter::fieldNames
protected

Vector with names of all the output fields.

◆ GlobalField_Counter

unsigned short CParallelDataSorter::GlobalField_Counter
protected

Number of output fields.

◆ idSend

unsigned long* CParallelDataSorter::idSend
protected

Send buffer holding global indices that will be send to other processors.

◆ Index

unsigned long* CParallelDataSorter::Index
protected

Index each point has in the send buffer.

◆ linearPartitioner

CLinearPartitioner CParallelDataSorter::linearPartitioner
protected

Linear partitioner based on the global number of points.

◆ nConn

unsigned long CParallelDataSorter::nConn
protected

Local size of the connectivity array.

◆ nConnGlobal

unsigned long CParallelDataSorter::nConnGlobal
protected

Global size of the connectivity array.

◆ nDim

unsigned short CParallelDataSorter::nDim
protected

Spatial dimension of the data.

◆ nElem

unsigned long CParallelDataSorter::nElem
protected

Local number of elements.

◆ nElem_Cum

int* CParallelDataSorter::nElem_Cum
protected

Cumulative number of elements.

◆ nElem_Send

int* CParallelDataSorter::nElem_Send
protected

Number of elements this processor has to send to other processors.

◆ nElemConn_Cum

unsigned long* CParallelDataSorter::nElemConn_Cum
protected

Cumulative number of element connectivity entries.

◆ nElemConn_Send

unsigned long* CParallelDataSorter::nElemConn_Send
protected

Number of element connectivity this processor has to send to other processors.

◆ nElemGlobal

unsigned long CParallelDataSorter::nElemGlobal
protected

Global number of elems without halos.

◆ nElemPerType

array<unsigned long, N_ELEM_TYPES> CParallelDataSorter::nElemPerType
protected

Local number of elements after sorting on this proc.

◆ nElemPerTypeGlobal

array<unsigned long, N_ELEM_TYPES> CParallelDataSorter::nElemPerTypeGlobal
protected

Global number of elements after sorting on this proc.

◆ nGlobalPointBeforeSort

unsigned long CParallelDataSorter::nGlobalPointBeforeSort
protected

Global number of points without halos before sorting.

◆ nLocalPointsBeforeSort

unsigned long CParallelDataSorter::nLocalPointsBeforeSort
protected

Local number of points without halos before sorting on this proc.

◆ nPoint_Recv

int* CParallelDataSorter::nPoint_Recv
protected

Number of points this processor receives from other processors.

◆ nPoint_Send

int* CParallelDataSorter::nPoint_Send
protected

Number of points this processor has to send to other processors.

◆ nPoints

unsigned long CParallelDataSorter::nPoints
protected

Local number of points.

◆ nPointsGlobal

unsigned long CParallelDataSorter::nPointsGlobal
protected

Global number of points without halos.

◆ nRecvs

int CParallelDataSorter::nRecvs
protected

Number of receives.

◆ nSends

int CParallelDataSorter::nSends
protected

Number of sends.

◆ rank

const int CParallelDataSorter::rank
protected

The MPI rank.

◆ requiredFieldNames

vector<string> CParallelDataSorter::requiredFieldNames
protected

Vector with names of the required output fields that we write to file.

◆ size

const int CParallelDataSorter::size
protected

The MPI size, aka the number of processors.

◆ [struct]

struct { ... } CParallelDataSorter::TypeMap

Map that stores the index for each GEO_TYPE type where to find information in the element arrays.


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