19template<
class real_type>
39 dg::
aRealGeometryX3d<real_type>(
generator.zeta0(
fx),
generator.zeta1(
fx),
generator.eta0(
fy),
generator.eta1(
fy), 0., 2.*
M_PI, ref.fx_new(
Nx,
fx),ref.fy_new(
Ny,
fy),
n, ref.nx_new(
Nx,
fx), ref.ny_new(
Ny,
fy),
Nz,
bcx,
bcy,
bcz), map_(3)
44 constructParallel(
Nz);
51 void constructParallel(
unsigned Nz)
55 unsigned size2d = this->
n()*this->
n()*this->
Nx()*this->
Ny();
57 for(
unsigned r=0; r<6;r++)
62 for(
unsigned k=1; k<
Nz; k++)
63 for(
unsigned i=0; i<size2d; i++)
65 for(
unsigned r=0; r<6; r++)
66 jac_.
values()[r][k*size2d+i] = jac_.
values()[r][(k-1)*size2d+i];
67 map_[0][k*size2d+i] = map_[0][(k-1)*size2d+i];
68 map_[1][k*size2d+i] = map_[1][(k-1)*size2d+i];
72 void constructPerp( real_type
fx, real_type
fy,
unsigned n,
unsigned Nx,
unsigned Ny)
74 std::vector<thrust::host_vector<real_type> > w(2),abs(2);
75 GridX2d g( this->
x0(),this->
x1(),this->
y0(),this->
y1(),fx,
fy,
n,
Nx,
Ny,this->
bcx(),this->
bcy());
76 ref_->generate(g,w[0],w[1],abs[0],abs[1]);
77 thrust::host_vector<real_type> x_vec(this->
n()*this->
Nx()), y_vec(this->
n()*this->
Ny());
78 for(
unsigned i=0; i<x_vec.size(); i++)
83 for(
unsigned i=0; i<y_vec.size(); i++)
85 y_vec[i] = abs[1][i*x_vec.size()];
88 jac_ = SparseTensor< thrust::host_vector<real_type>>( x_vec);
96 jac_.
idx(0,0) = 0, jac_.
idx(0,1) = 1, jac_.
idx(1,0)=2, jac_.
idx(1,1) = 3;
98 virtual SparseTensor<thrust::host_vector<real_type> > do_compute_jacobian( ) const override final{
101 virtual SparseTensor<thrust::host_vector<real_type> > do_compute_metric( ) const override final
103 return detail::square( jac_, map_[0], handle_->isOrthogonal());
105 virtual std::vector<thrust::host_vector<real_type> > do_compute_map()const override final{
return map_;}
106 std::vector<thrust::host_vector<real_type> > map_;
107 SparseTensor<thrust::host_vector<real_type> > jac_;
115template<
class real_type>
131 dg::
aRealGeometryX2d<real_type>(
generator.zeta0(
fx),
generator.zeta1(
fx),
generator.eta0(
fy),
generator.eta1(
fy),ref.fx_new(
Nx,
fx),ref.fy_new(
Ny,
fy),
n, ref.nx_new(
Nx,
fx), ref.ny_new(
Ny,
fy),
bcx,
bcy)
141 void construct(real_type
fx, real_type
fy,
unsigned n,
unsigned Nx,
unsigned Ny)
153 virtual SparseTensor<thrust::host_vector<real_type> > do_compute_metric( ) const override final{
156 virtual std::vector<thrust::host_vector<real_type> > do_compute_map()const override final{
return map_;}
158 std::vector<thrust::host_vector<real_type> > map_;
static DG_DEVICE double cooZ3d(double x, double y, double z)
void copy(const ContainerTypeIn &source, ContainerTypeOut &target)
void pointwiseDot(get_value_type< ContainerType > alpha, const ContainerType1 &x1, const ContainerType2 &x2, get_value_type< ContainerType > beta, ContainerType &y)
thrust::host_vector< real_type > evaluate(UnaryOp f, const RealGrid1d< real_type > &g)
int idx(unsigned i, unsigned j) const
std::vector< container > & values()
unsigned inner_Ny() const
unsigned outer_Ny() const
A two-dimensional grid based on curvilinear coordinates.
Definition: refined_curvilinearX.h:117
const aRealGeneratorX2d< real_type > & generator() const
Definition: refined_curvilinearX.h:138
virtual RealCurvilinearRefinedGridX2d * clone() const override final
Definition: refined_curvilinearX.h:139
RealCurvilinearRefinedGridX2d(const aRealRefinementX2d< real_type > &ref, 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::NEU)
Constructor.
Definition: refined_curvilinearX.h:130
A three-dimensional grid based on curvilinear coordinates.
Definition: refined_curvilinearX.h:21
const aRealGeneratorX2d< real_type > & generator() const
Definition: refined_curvilinearX.h:47
RealCurvilinearRefinedProductGridX3d(const aRealRefinementX2d< real_type > &ref, 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::NEU, bc bcz=dg::PER)
Constructor.
Definition: refined_curvilinearX.h:37
virtual RealCurvilinearRefinedProductGridX3d * clone() const override final
Definition: refined_curvilinearX.h:48
The abstract generator base class.
Definition: generatorX.h:19