Extension: Geometries
#include "dg/geometries/geometries.h"
generatorX.h
Go to the documentation of this file.
1#pragma once
2
3namespace dg
4{
5namespace geo
6{
7
17template<class real_type>
19{
20 real_type zeta0(real_type fx) const{return do_zeta0(fx);}
21 real_type zeta1(real_type fx) const{return do_zeta1(fx);}
22 real_type eta0(real_type fy) const{return do_eta0(fy);}
23 real_type eta1(real_type fy) const{return do_eta1(fy);}
25 bool isOrthogonal() const { return do_isOrthogonal(); }
26
44 const thrust::host_vector<real_type>& zeta1d,
45 const thrust::host_vector<real_type>& eta1d,
46 unsigned nodeX0, unsigned nodeX1,
47 thrust::host_vector<real_type>& x,
48 thrust::host_vector<real_type>& y,
49 thrust::host_vector<real_type>& zetaX,
50 thrust::host_vector<real_type>& zetaY,
51 thrust::host_vector<real_type>& etaX,
52 thrust::host_vector<real_type>& etaY) const
53 {
54 unsigned size = zeta1d.size()*eta1d.size();
55 x.resize(size), y.resize(size);
56 zetaX = zetaY = etaX = etaY =x ;
57 do_generate( zeta1d, eta1d,nodeX0,nodeX1,x,y,zetaX,zetaY,etaX,etaY);
58 }
59
65 virtual aRealGeneratorX2d* clone() const=0;
67
68 protected:
72 return *this;
73 }
74 private:
75 virtual void do_generate(
76 const thrust::host_vector<real_type>& zeta1d,
77 const thrust::host_vector<real_type>& eta1d,
78 unsigned nodeX0, unsigned nodeX1,
79 thrust::host_vector<real_type>& x,
80 thrust::host_vector<real_type>& y,
81 thrust::host_vector<real_type>& zetaX,
82 thrust::host_vector<real_type>& zetaY,
83 thrust::host_vector<real_type>& etaX,
84 thrust::host_vector<real_type>& etaY) const = 0;
85 virtual bool do_isOrthogonal()const{return false;}
86 virtual real_type do_zeta0(real_type fx) const=0;
87 virtual real_type do_zeta1(real_type fx) const=0;
88 virtual real_type do_eta0(real_type fy) const=0;
89 virtual real_type do_eta1(real_type fy) const=0;
90
91
92};
94
95}//namespace geo
96}//namespace dg
The abstract generator base class.
Definition: generatorX.h:19
virtual aRealGeneratorX2d * clone() const =0
Abstract clone method that returns a copy on the heap.
real_type zeta0(real_type fx) const
Definition: generatorX.h:20
aRealGeneratorX2d(const aRealGeneratorX2d &src)
Definition: generatorX.h:70
aRealGeneratorX2d()
Definition: generatorX.h:69
real_type eta0(real_type fy) const
Definition: generatorX.h:22
bool isOrthogonal() const
sparsity pattern for metric
Definition: generatorX.h:25
virtual ~aRealGeneratorX2d()
Definition: generatorX.h:66
real_type zeta1(real_type fx) const
Definition: generatorX.h:21
void generate(const thrust::host_vector< real_type > &zeta1d, const thrust::host_vector< real_type > &eta1d, unsigned nodeX0, unsigned nodeX1, thrust::host_vector< real_type > &x, thrust::host_vector< real_type > &y, thrust::host_vector< real_type > &zetaX, thrust::host_vector< real_type > &zetaY, thrust::host_vector< real_type > &etaX, thrust::host_vector< real_type > &etaY) const
Generate grid points and elements of the Jacobian.
Definition: generatorX.h:43
aRealGeneratorX2d & operator=(const aRealGeneratorX2d &src)
Definition: generatorX.h:71
real_type eta1(real_type fy) const
Definition: generatorX.h:23