Block-Structured AMR Software Framework
AMReX_AmrMeshDataAdaptor.H
Go to the documentation of this file.
1 #ifndef AMReX_AmrMeshDataAdaptor_h
2 #define AMReX_AmrMeshDataAdaptor_h
3 #include <AMReX_Config.H>
4 
5 #include "DataAdaptor.h"
6 #include <AMReX_AmrMesh.H>
7 #include <AMReX_MultiFab.H>
8 
9 namespace amrex
10 {
11 
12 class AmrMeshDataAdaptor : public sensei::DataAdaptor
13 {
14 public:
16  senseiTypeMacro(AmrMeshDataAdaptor, sensei::DataAdaptor);
17 
18  // set the source of the simulation data
19  int SetDataSource(amrex::AmrMesh *mesh,
20  const std::vector<amrex::Vector<amrex::MultiFab>*> &states,
21  const std::vector<std::vector<std::string>> &arrayNames);
22 
23  // force mesh origin to 0,0,0. off by default
24  void SetPinMesh(int val);
25 
26  // SENSEI API
27  int GetNumberOfMeshes(unsigned int &numMeshes) override;
28 #if SENSEI_VERSION_MAJOR >= 3
29  int GetMeshMetadata(unsigned int id, sensei::MeshMetadataPtr &metadata) override;
30 #else
31  int GetMeshName(unsigned int id, std::string &meshName) override;
32  int GetMeshHasGhostNodes(const std::string &meshName, int &nLayers) override;
33  int GetMeshHasGhostCells(const std::string &meshName, int &nLayers) override;
34  int GetNumberOfArrays(const std::string &meshName, int association, unsigned int &numberOfArrays) override;
35  int GetArrayName(const std::string &meshName, int association, unsigned int index, std::string &arrayName) override;
36 #endif
37  int GetMesh(const std::string &meshName, bool structureOnly, svtkDataObject *&mesh) override;
38  int AddGhostNodesArray(svtkDataObject* mesh, const std::string &meshName) override;
39  int AddGhostCellsArray(svtkDataObject* mesh, const std::string &meshName) override;
40  int AddArray(svtkDataObject* mesh, const std::string &meshName, int association, const std::string &arrayName) override;
41  int ReleaseData() override;
42 
43 protected:
46 
47 private:
48  struct InternalsType;
50 };
51 
52 }
53 
54 #endif
Definition: AMReX_AmrMeshDataAdaptor.H:13
int AddGhostNodesArray(svtkDataObject *mesh, const std::string &meshName) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:600
~AmrMeshDataAdaptor()
Definition: AMReX_AmrMeshDataAdaptor.cpp:100
int GetMeshHasGhostCells(const std::string &meshName, int &nLayers) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:453
int AddGhostCellsArray(svtkDataObject *mesh, const std::string &meshName) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:616
AmrMeshDataAdaptor()
Definition: AMReX_AmrMeshDataAdaptor.cpp:94
InternalsType * Internals
Definition: AMReX_AmrMeshDataAdaptor.H:48
senseiTypeMacro(AmrMeshDataAdaptor, sensei::DataAdaptor)
int GetArrayName(const std::string &meshName, int association, unsigned int index, std::string &arrayName) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:418
int GetNumberOfMeshes(unsigned int &numMeshes) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:128
int GetNumberOfArrays(const std::string &meshName, int association, unsigned int &numberOfArrays) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:388
static AmrMeshDataAdaptor * New()
int ReleaseData() override
Definition: AMReX_AmrMeshDataAdaptor.cpp:904
int AddArray(svtkDataObject *mesh, const std::string &meshName, int association, const std::string &arrayName) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:737
int GetMesh(const std::string &meshName, bool structureOnly, svtkDataObject *&mesh) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:477
int SetDataSource(amrex::AmrMesh *mesh, const std::vector< amrex::Vector< amrex::MultiFab > * > &states, const std::vector< std::vector< std::string >> &arrayNames)
Definition: AMReX_AmrMeshDataAdaptor.cpp:106
int GetMeshName(unsigned int id, std::string &meshName) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:381
int GetMeshHasGhostNodes(const std::string &meshName, int &nLayers) override
Definition: AMReX_AmrMeshDataAdaptor.cpp:439
void SetPinMesh(int val)
Definition: AMReX_AmrMeshDataAdaptor.cpp:122
Definition: AMReX_AmrMesh.H:62
Definition: AMReX_Amr.cpp:49
Definition: AMReX_AmrMeshDataAdaptor.cpp:76