IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
Mesh.h
Go to the documentation of this file.
1//
2// Class Mesh
3// The Mesh base class. Right now, this mainly acts as a standard base
4// class for all meshes so that other objects can register as users of
5// the mesh and can be notified if the mesh changes (e.g., it is rescaled
6// or restructured entirely).
7//
8#ifndef IPPL_MESH_H
9#define IPPL_MESH_H
10
11#include "Types/Vector.h"
12
13namespace ippl {
14 template <typename T, unsigned Dim>
15 class Mesh {
16 public:
17 typedef T value_type;
18 enum {
20 };
21
24
25 KOKKOS_INLINE_FUNCTION Mesh(){};
26
27 KOKKOS_INLINE_FUNCTION virtual ~Mesh(){};
28
29 // Get the origin of mesh vertex positions
30 KOKKOS_INLINE_FUNCTION vector_type getOrigin() const;
31
32 // Set the origin of mesh vertex positions
33 KOKKOS_INLINE_FUNCTION void setOrigin(const vector_type& origin);
34
35 KOKKOS_INLINE_FUNCTION const vector_type& getGridsize() const;
36
41 KOKKOS_INLINE_FUNCTION virtual T getCellVolume() const = 0;
42
47 KOKKOS_INLINE_FUNCTION virtual T getMeshVolume() const = 0;
48
49 KOKKOS_INLINE_FUNCTION T getGridsize(size_t dim) const;
50
51 KOKKOS_INLINE_FUNCTION virtual vector_type getVertexPosition(
52 const NDIndex<Dim>& ndi) const = 0;
53
54 KOKKOS_INLINE_FUNCTION virtual const vector_type& getMeshSpacing() const = 0;
55
56 KOKKOS_INLINE_FUNCTION virtual vector_type getDeltaVertex(
57 const NDIndex<Dim>& ndi) const = 0;
58
59 protected:
60 vector_type origin_m; // Origin of mesh coordinates (vertices)
61 vector_type gridSizes_m; // Sizes (number of vertices)
62 };
63} // namespace ippl
64
65#include "Meshes/Mesh.hpp"
66
67#endif
constexpr unsigned Dim
Definition Archive.h:20
virtual KOKKOS_INLINE_FUNCTION vector_type getVertexPosition(const NDIndex< Dim > &ndi) const =0
Vector< vector_type, Dim > matrix_type
Definition Mesh.h:23
Vector< T, Dim > vector_type
Definition Mesh.h:22
T value_type
Definition Mesh.h:17
virtual KOKKOS_INLINE_FUNCTION T getCellVolume() const =0
KOKKOS_INLINE_FUNCTION Mesh()
Definition Mesh.h:25
KOKKOS_INLINE_FUNCTION vector_type getOrigin() const
Definition Mesh.hpp:10
KOKKOS_INLINE_FUNCTION T getGridsize(size_t dim) const
Definition Mesh.hpp:26
KOKKOS_INLINE_FUNCTION void setOrigin(const vector_type &origin)
Definition Mesh.hpp:15
virtual KOKKOS_INLINE_FUNCTION ~Mesh()
Definition Mesh.h:27
virtual KOKKOS_INLINE_FUNCTION T getMeshVolume() const =0
virtual KOKKOS_INLINE_FUNCTION const vector_type & getMeshSpacing() const =0
KOKKOS_INLINE_FUNCTION const vector_type & getGridsize() const
Definition Mesh.hpp:20
vector_type gridSizes_m
Definition Mesh.h:61
vector_type origin_m
Definition Mesh.h:60
virtual KOKKOS_INLINE_FUNCTION vector_type getDeltaVertex(const NDIndex< Dim > &ndi) const =0