SENSEI
A frame work for generic in situ analytics
sensei::DataRequirements Class Reference

This is a helper class that handles the common task of specifying the set of meshes and arrays rqeuired to perform a specific analysis. More...

#include <DataRequirements.h>

Public Types

using AssocArrayMapType = std::map< int, std::vector< std::string > >
 
using MeshArrayMapType = std::map< std::string, AssocArrayMapType >
 
using MeshNamesType = std::map< std::string, bool >
 

Public Member Functions

bool Empty () const
 Returns true if the object is empty. More...
 
int Initialize (pugi::xml_node parent)
 initialize from XML. More...
 
int Initialize (DataAdaptor *adaptor, bool structureOnly)
 This is a convenience method that fills in all of data that the data adaptor makes avaialable. More...
 
int AddRequirement (const std::string &meshName, bool structureOnly)
 Adds a mesh. More...
 
int AddRequirement (const std::string &meshName, int association, const std::vector< std::string > &arrays)
 Adds a set of arrays on a specific mesh. More...
 
int AddRequirement (const std::string &meshName, int association, const std::string &array)
 Adds a set of arrays on a specific mesh. More...
 
int GetRequiredMeshes (std::vector< std::string > &meshes) const
 Get the list of meshes. More...
 
unsigned int GetNumberOfRequiredMeshes () const
 Get the number of required meshes. More...
 
int GetRequiredMesh (unsigned int id, std::string &mesh) const
 Get the name of the ith required mesh. More...
 
int GetRequiredArrays (const std::string &meshName, int association, std::vector< std::string > &arrays) const
 For the named mesh, gets the list of required arrays. More...
 
int GetNumberOfRequiredArrays (const std::string &meshName, int association, unsigned int &nArrays) const
 For the named mesh, and association, gets the number of required arrays. More...
 
void Clear ()
 Clear the contents of the container. More...
 
MeshRequirementsIterator GetMeshRequirementsIterator () const
 Get an iterator for the named mesh. More...
 
ArrayRequirementsIterator GetArrayRequirementsIterator (const std::string &meshName) const
 Get an iterator for the associated arrays. More...
 

Friends

class ArrayRequirementsIterator
 
class MeshRequirementsIterator
 

Detailed Description

This is a helper class that handles the common task of specifying the set of meshes and arrays rqeuired to perform a specific analysis.

An analysis would typically intialize the data requirement from XML and then probe the requirements during execution to get the minimal set of data required to complete the analysis.

Member Function Documentation

◆ AddRequirement() [1/3]

int sensei::DataRequirements::AddRequirement ( const std::string &  meshName,
bool  structureOnly 
)

Adds a mesh.

The requirement consists of a mesh name and weather it is structure only

Parameters
[in]meshNamename of the mesh
[in]structureOnlyflag indicating if mesh geometry is needed
Returns
zero if successful

◆ AddRequirement() [2/3]

int sensei::DataRequirements::AddRequirement ( const std::string &  meshName,
int  association,
const std::vector< std::string > &  arrays 
)

Adds a set of arrays on a specific mesh.

The requirement consists of a mesh name and a list of arrays

Parameters
[in]meshNamename of the mesh
[in]associationtype of arrays
[in]arraysa list of the required arrays
Returns
zero if successful

◆ AddRequirement() [3/3]

int sensei::DataRequirements::AddRequirement ( const std::string &  meshName,
int  association,
const std::string &  array 
)

Adds a set of arrays on a specific mesh.

The requirement consists of a mesh name and a list of arrays

Parameters
[in]meshNamename of the mesh
[in]associationtype of the required array
[in]arrayname of the required array
Returns
zero if successful

◆ Clear()

void sensei::DataRequirements::Clear ( )

Clear the contents of the container.

◆ Empty()

bool sensei::DataRequirements::Empty ( ) const
inline

Returns true if the object is empty.

◆ GetArrayRequirementsIterator()

ArrayRequirementsIterator sensei::DataRequirements::GetArrayRequirementsIterator ( const std::string &  meshName) const

Get an iterator for the associated arrays.

◆ GetMeshRequirementsIterator()

MeshRequirementsIterator sensei::DataRequirements::GetMeshRequirementsIterator ( ) const

Get an iterator for the named mesh.

◆ GetNumberOfRequiredArrays()

int sensei::DataRequirements::GetNumberOfRequiredArrays ( const std::string &  meshName,
int  association,
unsigned int &  nArrays 
) const

For the named mesh, and association, gets the number of required arrays.

Parameters
[in]meshNamethe name of the mesh
[in]associationsvtkDataObject::POINT, svtkDataObject::CELL, etc
[out]numberof arrays
Returns
zero if successful

◆ GetNumberOfRequiredMeshes()

unsigned int sensei::DataRequirements::GetNumberOfRequiredMeshes ( ) const

Get the number of required meshes.

◆ GetRequiredArrays()

int sensei::DataRequirements::GetRequiredArrays ( const std::string &  meshName,
int  association,
std::vector< std::string > &  arrays 
) const

For the named mesh, gets the list of required arrays.

Parameters
[in]meshNamethe name of the mesh
[in]associationsvtkDataObject::POINT, svtkDataObject::CELL, etc
[out]arraysa vector where the arrays will be stored
Returns
zero if successful

◆ GetRequiredMesh()

int sensei::DataRequirements::GetRequiredMesh ( unsigned int  id,
std::string &  mesh 
) const

Get the name of the ith required mesh.

◆ GetRequiredMeshes()

int sensei::DataRequirements::GetRequiredMeshes ( std::vector< std::string > &  meshes) const

Get the list of meshes.

Parameters
[out]meshesa vector where mesh names will be stored
Returns
zero if successful

◆ Initialize() [1/2]

int sensei::DataRequirements::Initialize ( pugi::xml_node  parent)

initialize from XML.

the XML should contain one or more mesh elements each with zero or more array groups

<parent>
<mesh name="mesh_1" structure_only="1">
<cell_arrays> array_1, ... array_n </cell_arrays>
<point_arrays> array_1, ... array_n </point_arrays>
</mesh>
.
.
.
<mesh name="mesh_n" structure_only="0">
<cell_arrays> array_1, ... array_n </cell_arrays>
<point_arrays> array_1, ... array_n </point_arrays>
</mesh>
</parent>
Parameters
[in]parentXML node which contains mesh elements
Returns
the number of mesh elements processed.

◆ Initialize() [2/2]

int sensei::DataRequirements::Initialize ( DataAdaptor adaptor,
bool  structureOnly 
)

This is a convenience method that fills in all of data that the data adaptor makes avaialable.

Parameters
[in]adaptora DataAdaptor instance
[in]structureOnlytrue if mesh geometry and topology are not needed
Returns
zero if successful, non zero if an error occurred

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