Skip to content

Request specific meshes

Burlen Loring requested to merge request_specific_meshes into master

There is no mechanism in the SENSEI 1 DataAdaptor to request specific mesh. This becomes an issue when a simulation produces multiple meshes. Variable names may not be unique across meshes. An analysis would likely need only a subset of the available data. It may need fields from multiple meshes or just one of them.

An motivating example is the Warp LPA simulation code, which computes the solution of a number of different particle species and has a Cartesian (or block structured AMR) meshes for the solution of magnetic and electric fields, and conserved quantities. Particle species can be molecules or sub atomic particles such as protons and electrons. There can be multiple species of the same sub atomic particle type, for instance electrons separated from different molecules/atoms are kept in distinct species identifying which molecules/atoms they derived from. The number of species present in given simulation is problem specific. Warp provides a programatic means of determining the meshes in play in a given run.

Existing DataAdaptor API:

virtual vtkDataObject* GetMesh(bool structure_only=false) = 0;
virtual bool AddArray(vtkDataObject* mesh, int association, const std::string& arrayname) = 0;
virtual unsigned int GetNumberOfArrays(int association) = 0;
virtual std::string GetArrayName(int association, unsigned int index) = 0;
virtual void ReleaseData() = 0;

Multi-mesh DataAdaptorAPI:

To Solve the problem the DataAdaptor API is augmented with a mesh name, a string that idenitifies which mesh is desired. Two new pure virtual methods are needed so that an analysis can discover the available meshes.

virtual int GetNumberOfMeshes(int &numMeshes) = 0;

virtual int GetMeshName(int id, std::string &meshName) = 0;

virtual int GetMesh(const std::string &meshName, bool structure_only,
  vtkDataObject *&mesh) = 0;

virtual int AddArray(vtkDataObject* mesh, const std::string &meshName,
  int association, const std::string& arrayname) = 0;

virtual int GetNumberOfArrays(const std::string &meshName, int association,
  unsigned int &numberOfArrays) = 0;

virtual int GetArrayName(const std::string &meshName, int association,
  unsigned int index, std::string &arrayName) = 0;

virtual int ReleaseData() = 0;

meshName identifies the mesh where necessary. In all API an int is returned, zero indicates success, non zero an error.

Edited by Burlen Loring

Merge request reports