19template<
class real_type>
38 dg::
aRealGeometryX3d<real_type>(
generator.zeta0(
fx),
generator.zeta1(
fx),
generator.eta0(
fy),
generator.eta1(
fy), 0., 2.*
M_PI,
fx,
fy,
n,
Nx,
Ny,
Nz,
bcx,
bcy,
bcz)
42 constructPerp(
n,
Nx,
Ny);
43 constructParallel(
Nz);
50 void constructParallel(
unsigned Nz)
54 unsigned size2d = this->
n()*this->
n()*this->
Nx()*this->
Ny();
56 for(
unsigned r=0; r<6;r++)
61 for(
unsigned k=1; k<
Nz; k++)
62 for(
unsigned i=0; i<size2d; i++)
64 for(
unsigned r=0; r<6; r++)
65 jac_.
values()[r][k*size2d+i] = jac_.
values()[r][(k-1)*size2d+i];
66 map_[0][k*size2d+i] = map_[0][(k-1)*size2d+i];
67 map_[1][k*size2d+i] = map_[1][(k-1)*size2d+i];
71 void constructPerp(
unsigned n,
unsigned Nx,
unsigned Ny)
77 jac_ = SparseTensor< thrust::host_vector<real_type>>( x_vec);
79 handle_->generate( x_vec, y_vec, gY1d.n()*gY1d.outer_N(), gY1d.n()*(gY1d.inner_N()+gY1d.outer_N()), map_[0], map_[1], jac_.
values()[2], jac_.
values()[3], jac_.
values()[4], jac_.
values()[5]);
80 jac_.
idx(0,0) = 2, jac_.
idx(0,1) = 3, jac_.
idx(1,0)=4, jac_.
idx(1,1) = 5;
82 virtual SparseTensor<thrust::host_vector<real_type>> do_compute_jacobian( ) const override final{
85 virtual SparseTensor<thrust::host_vector<real_type>> do_compute_metric( ) const override final
87 return detail::square( jac_, map_[0], handle_->isOrthogonal());
89 virtual std::vector<thrust::host_vector<real_type>> do_compute_map()const override final{
return map_;}
90 std::vector<thrust::host_vector<real_type>> map_;
91 SparseTensor<thrust::host_vector<real_type>> jac_;
98template<
class real_type>
113 dg::
aRealGeometryX2d<real_type>(
generator.zeta0(
fx),
generator.zeta1(
fx),
generator.eta0(
fy),
generator.eta1(
fy),
fx,
fy,
n,
Nx,
Ny,
bcx,
bcy), handle_(
generator)
121 void construct( real_type
fx, real_type
fy,
unsigned n,
unsigned Nx,
unsigned Ny)
133 virtual SparseTensor<thrust::host_vector<real_type>> do_compute_metric( ) const override final{
136 virtual std::vector<thrust::host_vector<real_type>> do_compute_map()const override final{
return map_;}
138 std::vector<thrust::host_vector<real_type>> map_;
static DG_DEVICE double cooX1d(double x)
static DG_DEVICE double cooZ3d(double x, double y, double z)
void copy(const ContainerTypeIn &source, ContainerTypeOut &target)
thrust::host_vector< real_type > evaluate(UnaryOp f, const RealGrid1d< real_type > &g)
int idx(unsigned i, unsigned j) const
std::vector< container > & values()
A two-dimensional grid based on curvilinear coordinates.
Definition: curvilinearX.h:100
RealCurvilinearGridX2d(const aRealGeneratorX2d< real_type > &generator, real_type fx, real_type fy, unsigned n, unsigned Nx, unsigned Ny, dg::bc bcx=dg::DIR, bc bcy=dg::PER)
Constructor.
Definition: curvilinearX.h:112
const aRealGeneratorX2d< real_type > & generator() const
Definition: curvilinearX.h:118
virtual RealCurvilinearGridX2d * clone() const override final
Definition: curvilinearX.h:119
A three-dimensional grid based on curvilinear coordinates.
Definition: curvilinearX.h:21
RealCurvilinearProductGridX3d(const aRealGeneratorX2d< real_type > &generator, real_type fx, real_type fy, unsigned n, unsigned Nx, unsigned Ny, unsigned Nz, bc bcx=dg::DIR, bc bcy=dg::PER, bc bcz=dg::PER)
Constructor.
Definition: curvilinearX.h:36
virtual RealCurvilinearProductGridX3d * clone() const override final
Definition: curvilinearX.h:47
const aRealGeneratorX2d< real_type > & generator() const
Definition: curvilinearX.h:46
The abstract generator base class.
Definition: generatorX.h:19