Block-Structured AMR Software Framework
AMReX_AmrDataAdaptor.H
Go to the documentation of this file.
1 #ifndef AMReX_AmrDataAdaptor_h
2 #define AMReX_AmrDataAdaptor_h
3 #include <AMReX_Config.H>
4 
5 #include "DataAdaptor.h"
6 #include <AMReX_Amr.H>
7 
8 namespace amrex
9 {
10 class AmrDataAdaptor : public sensei::DataAdaptor
11 {
12 public:
13  static AmrDataAdaptor* New();
14  senseiTypeMacro(AmrDataAdaptor, sensei::DataAdaptor);
15 
16  // set the source of the simulation data
17  int SetDataSource(amrex::Amr *amr);
18 
19  // force mesh origin to 0,0,0. Off by default
20  void SetPinMesh(int val);
21 
22  // SENSEI API
23  int GetNumberOfMeshes(unsigned int &numMeshes) override;
24 #if SENSEI_VERSION_MAJOR >= 3
25  int GetMeshMetadata(unsigned int id, sensei::MeshMetadataPtr &metadata) override;
26 #else
27  int GetMeshName(unsigned int id, std::string &meshName) override;
28  int GetMeshHasGhostNodes(const std::string &meshName, int &nLayers) override;
29  int GetMeshHasGhostCells(const std::string &meshName, int &nLayers) override;
30  int GetNumberOfArrays(const std::string &meshName, int association, unsigned int &numberOfArrays) override;
31  int GetArrayName(const std::string &meshName, int association, unsigned int index, std::string &arrayName) override;
32 #endif
33  int GetMesh(const std::string &meshName, bool structureOnly, svtkDataObject *&mesh) override;
34  int AddGhostNodesArray(svtkDataObject* mesh, const std::string &meshName) override;
35  int AddGhostCellsArray(svtkDataObject* mesh, const std::string &meshName) override;
36  int AddArray(svtkDataObject* mesh, const std::string &meshName, int association, const std::string &arrayName) override;
37  int ReleaseData() override;
38 
39 protected:
42 
43 private:
44  struct InternalsType;
46 };
47 
48 }
49 
50 #endif
Definition: AMReX_AmrDataAdaptor.H:11
int GetMesh(const std::string &meshName, bool structureOnly, svtkDataObject *&mesh) override
Definition: AMReX_AmrDataAdaptor.cpp:605
int AddGhostNodesArray(svtkDataObject *mesh, const std::string &meshName) override
Definition: AMReX_AmrDataAdaptor.cpp:819
int AddGhostCellsArray(svtkDataObject *mesh, const std::string &meshName) override
Definition: AMReX_AmrDataAdaptor.cpp:725
int GetMeshHasGhostNodes(const std::string &meshName, int &nLayers) override
Definition: AMReX_AmrDataAdaptor.cpp:511
int AddArray(svtkDataObject *mesh, const std::string &meshName, int association, const std::string &arrayName) override
Definition: AMReX_AmrDataAdaptor.cpp:837
AmrDataAdaptor()
Definition: AMReX_AmrDataAdaptor.cpp:168
static AmrDataAdaptor * New()
int GetMeshHasGhostCells(const std::string &meshName, int &nLayers) override
Definition: AMReX_AmrDataAdaptor.cpp:525
int GetNumberOfMeshes(unsigned int &numMeshes) override
Definition: AMReX_AmrDataAdaptor.cpp:204
int GetMeshName(unsigned int id, std::string &meshName) override
InternalsType * Internals
Definition: AMReX_AmrDataAdaptor.H:44
int ReleaseData() override
Definition: AMReX_AmrDataAdaptor.cpp:1006
senseiTypeMacro(AmrDataAdaptor, sensei::DataAdaptor)
~AmrDataAdaptor()
Definition: AMReX_AmrDataAdaptor.cpp:174
int GetArrayName(const std::string &meshName, int association, unsigned int index, std::string &arrayName) override
Definition: AMReX_AmrDataAdaptor.cpp:579
int SetDataSource(amrex::Amr *amr)
Definition: AMReX_AmrDataAdaptor.cpp:180
int GetNumberOfArrays(const std::string &meshName, int association, unsigned int &numberOfArrays) override
Definition: AMReX_AmrDataAdaptor.cpp:547
void SetPinMesh(int val)
Definition: AMReX_AmrDataAdaptor.cpp:198
Manage hierarchy of levels for time-dependent AMR computations.
Definition: AMReX_Amr.H:35
Definition: AMReX_Amr.cpp:49
Definition: AMReX_AmrDataAdaptor.cpp:152