Program Listing for File gridHost.hpp

Return to documentation for file (gridHost.hpp)

// ***********************************************************************************
// Idefix MHD astrophysical code
// Copyright(C) 2020-2022 Geoffroy R. J. Lesur <geoffroy.lesur@univ-grenoble-alpes.fr>
// and other code contributors
// Licensed under CeCILL 2.1 License, see COPYING for more information
// ***********************************************************************************

#ifndef GRIDHOST_HPP_
#define GRIDHOST_HPP_

#include <vector>
#include "idefix.hpp"
#include "grid.hpp"
#include "input.hpp"


class GridHost {
 public:
  std::vector<IdefixArray1D<real>::HostMirror> x;
  std::vector<IdefixArray1D<real>::HostMirror> xr;
  std::vector<IdefixArray1D<real>::HostMirror> xl;
  std::vector<IdefixArray1D<real>::HostMirror> dx;

  std::vector<real> xbeg;
  std::vector<real> xend;

  std::vector<int> np_tot;
  std::vector<int> np_int;

  std::vector<int> nghost;
  std::vector<BoundaryType> lbound;
  std::vector<BoundaryType> rbound;

  bool haveAxis=false;

  explicit GridHost(Grid&);
  GridHost() = default;

  void MakeGrid(Input &);

  void SyncFromDevice();
  void SyncToDevice();

 private:
  Grid *grid;
};

#endif // GRIDHOST_HPP_