32template<
class Functor,
class real_type>
35 std::vector<thrust::host_vector<real_type> > map = g.
map();
36 thrust::host_vector<real_type> vec( g.
size());
37 for(
unsigned i=0; i<g.
size(); i++)
38 vec[i] = f( map[0][i], map[1][i]);
47template<
class Functor,
class real_type>
50 std::vector<thrust::host_vector<real_type> > map = g.
map();
51 thrust::host_vector<real_type> vec( g.
size());
52 for(
unsigned i=0; i<g.
size(); i++)
53 vec[i] = f( map[0][i], map[1][i], map[2][i]);
61template<
class Functor,
class real_type>
64 std::vector<MPI_Vector<thrust::host_vector<real_type> > > map = g.
map();
65 thrust::host_vector<real_type> vec( g.
local().size());
66 for(
unsigned i=0; i<g.
local().size(); i++)
67 vec[i] = f( map[0].data()[i], map[1].data()[i]);
76template<
class Functor,
class real_type>
79 std::vector<MPI_Vector<thrust::host_vector<real_type> > > map = g.
map();
80 thrust::host_vector<real_type> vec( g.
local().size());
81 for(
unsigned i=0; i<g.
local().size(); i++)
82 vec[i] = f( map[0].data()[i], map[1].data()[i], map[2].data()[i]);
106template<
class Functor1,
class Functor2,
class container,
class Geometry>
108 container& vx, container& vy,
111 using host_vec = get_host_vector<Geometry>;
140template<
class Functor1,
class Functor2,
class Functor3,
class container,
class Geometry>
141void pushForward(
const Functor1& vR,
const Functor2& vZ,
const Functor3& vPhi,
142 container& vx, container& vy, container& vz,
145 using host_vec = get_host_vector<Geometry>;
177template<
class FunctorRR,
class FunctorRZ,
class FunctorZZ,
class container,
class Geometry>
178void pushForwardPerp(
const FunctorRR& chiRR,
const FunctorRZ& chiRZ,
const FunctorZZ& chiZZ,
182 using host_vec = get_host_vector<Geometry>;
183 host_vec chiRR_ =
pullback( chiRR, g);
184 host_vec chiRZ_ =
pullback( chiRZ, g);
185 host_vec chiZZ_ =
pullback( chiZZ, g);
188 std::vector<container> values( 5);
194 chi.
idx(0,0)=2, chi.
idx(0,1)=chi.
idx(1,0)=3, chi.
idx(1,1)=4;
195 chi.
idx(2,0)=chi.
idx(2,1)=chi.
idx(0,2)=chi.
idx(1,2) = 0;
199 container tmp00(jac.
value(0,0)), tmp01(tmp00), tmp10(tmp00), tmp11(tmp00);
224template<
class Geometry>
225get_host_vector<Geometry>
volume(
const Geometry& g)
227 using host_vector = get_host_vector<Geometry>;
243template<
class Geometry>
246 using host_vector = get_host_vector<Geometry>;
248 host_vector vol =
volume(g);
void assign(const from_ContainerType &from, ContainerType &to, Params &&... ps)
Generic way to assign the contents of a from_ContainerType object to a ContainerType object optionall...
Definition: blas1.h:665
static DG_DEVICE double one(double x)
Definition: functions.h:20
static DG_DEVICE double zero(double x)
Definition: functions.h:29
void transform(const ContainerType1 &x, ContainerType &y, UnaryOp op)
Definition: blas1.h:524
void pointwiseDot(get_value_type< ContainerType > alpha, const ContainerType1 &x1, const ContainerType2 &x2, get_value_type< ContainerType > beta, ContainerType &y)
Definition: blas1.h:336
thrust::host_vector< real_type > evaluate(UnaryOp f, const RealGrid1d< real_type > &g)
Evaluate a 1d function on grid coordinates.
Definition: evaluation.h:67
MPI_Vector< thrust::host_vector< real_type > > weights(const aRealMPITopology2d< real_type > &g)
Nodal weight coefficients.
Definition: mpi_weights.h:22
get_host_vector< Geometry > volume(const Geometry &g)
Create the volume element on the grid (including weights!!)
Definition: transform.h:225
get_host_vector< Geometry > inv_volume(const Geometry &g)
Create the inverse volume element on the grid (including weights!!)
Definition: transform.h:244
thrust::host_vector< real_type > pullback(const Functor &f, const aRealGeometryX2d< real_type > &g)
Definition: base_geometryX.h:147
void pushForwardPerp(const Functor1 &vR, const Functor2 &vZ, container &vx, container &vy, const Geometry &g)
Definition: transform.h:107
void pushForward(const Functor1 &vR, const Functor2 &vZ, const Functor3 &vPhi, container &vx, container &vy, container &vz, const Geometry &g)
Definition: transform.h:141
void multiply2d(const ContainerTypeL &lambda, const SparseTensor< ContainerType0 > &t, const ContainerType1 &in0, const ContainerType2 &in1, const ContainerTypeM &mu, ContainerType3 &out0, ContainerType4 &out1)
Definition: multiply.h:230
ContainerType volume(const SparseTensor< ContainerType > &t)
Definition: multiply.h:406
void multiply3d(const ContainerTypeL &lambda, const SparseTensor< ContainerType0 > &t, const ContainerType1 &in0, const ContainerType2 &in1, const ContainerType3 &in2, const ContainerTypeM &mu, ContainerType4 &out0, ContainerType5 &out1, ContainerType6 &out2)
Definition: multiply.h:256
typename TensorTraits< std::decay_t< Vector > >::value_type get_value_type
Definition: tensor_traits.h:38
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
Definition: functors.h:134
mpi Vector class
Definition: mpi_vector.h:32
Class for 2x2 and 3x3 matrices sharing elements.
Definition: tensor.h:66
int idx(unsigned i, unsigned j) const
read index into the values array at the given position
Definition: tensor.h:134
std::vector< container > & values()
Return write access to the values array.
Definition: tensor.h:166
const container & value(size_t i, size_t j) const
Read access the underlying container.
Definition: tensor.h:156
This is the abstract interface class for a two-dimensional Geometry.
Definition: base_geometry.h:15
std::vector< thrust::host_vector< real_type > > map() const
The coordinate map from computational to physical space.
Definition: base_geometry.h:56
This is the abstract interface class for a three-dimensional Geometry.
Definition: base_geometry.h:89
std::vector< thrust::host_vector< real_type > > map() const
The coordinate map from computational to physical space.
Definition: base_geometry.h:135
This is the abstract interface class for a two-dimensional Geometry.
Definition: mpi_base.h:18
std::vector< MPI_Vector< thrust::host_vector< real_type > > > map() const
The coordinate map from computational to physical space.
Definition: mpi_base.h:28
This is the abstract interface class for a three-dimensional MPIGeometry.
Definition: mpi_base.h:63
std::vector< MPI_Vector< thrust::host_vector< real_type > > > map() const
The coordinate map from computational to physical space.
Definition: mpi_base.h:73
const RealGrid2d< real_type > & local() const
Return a non-MPI grid local for the calling process.
Definition: mpi_grid.h:252
MPI_Comm communicator() const
Return mpi cartesian communicator that is used in this grid.
Definition: mpi_grid.h:138
MPI_Comm communicator() const
Return mpi cartesian communicator that is used in this grid.
Definition: mpi_grid.h:459
const RealGrid3d< real_type > & local() const
Return a non-MPI grid local for the calling process.
Definition: mpi_grid.h:560
unsigned size() const
The total number of points.
Definition: grid.h:424
unsigned size() const
The total number of points.
Definition: grid.h:670
Creation functions for integration weights and their inverse.