14template<
class thrust_vector0,
class thrust_vector1>
15void sendForward(
const thrust_vector0& in, thrust_vector1& out, MPI_Comm comm)
19 MPI_Cart_shift( comm, 2, +1, &source, &dest);
20#if THRUST_DEVICE_SYSTEM==THRUST_DEVICE_SYSTEM_CUDA
23 cudaError_t code = cudaGetLastError( );
24 if( code != cudaSuccess)
26 code = cudaDeviceSynchronize();
27 if( code != cudaSuccess)
31 unsigned size = in.size();
32 MPI_Sendrecv( thrust::raw_pointer_cast(in.data()), size, MPI_DOUBLE,
34 thrust::raw_pointer_cast(out.data()), size, MPI_DOUBLE,
39template<
class thrust_vector0,
class thrust_vector1>
40void sendBackward(
const thrust_vector0& in, thrust_vector1& out, MPI_Comm comm)
44 MPI_Cart_shift( comm, 2, -1, &source, &dest);
45#if THRUST_DEVICE_SYSTEM==THRUST_DEVICE_SYSTEM_CUDA
48 cudaError_t code = cudaGetLastError( );
49 if( code != cudaSuccess)
51 code = cudaDeviceSynchronize();
52 if( code != cudaSuccess)
56 unsigned size = in.size();
57 MPI_Sendrecv( thrust::raw_pointer_cast(in.data()), size, MPI_DOUBLE,
59 thrust::raw_pointer_cast(out.data()), size, MPI_DOUBLE,
65template <
class ProductMPIGeometry,
class LocalIMatrix,
class CommunicatorXY,
class LocalContainer>
66struct Fieldaligned< ProductMPIGeometry, MPIDistMat<LocalIMatrix, CommunicatorXY>, MPI_Vector<LocalContainer> >
69 template <
class Limiter>
71 const ProductMPIGeometry&
grid,
76 unsigned mx=12,
unsigned my=12,
77 double deltaPhi = -1, std::string interpolation_method =
"linear-nearest",
78 bool benchmark =
true):
80 mx, my,
deltaPhi, interpolation_method)
83 template <
class Limiter>
85 const ProductMPIGeometry&
grid,
90 unsigned mx=12,
unsigned my=12,
91 double deltaPhi = -1, std::string interpolation_method =
"linear-nearest",
92 bool benchmark =
true);
93 template<
class ...Params>
114 void set_boundaries(
dg::bc bcz,
const MPI_Vector<LocalContainer>& left,
const MPI_Vector<LocalContainer>& right)
121 void set_boundaries(
dg::bc bcz,
const MPI_Vector<LocalContainer>& global,
double scal_left,
double scal_right)
129 void operator()(
enum whichMatrix which,
const MPI_Vector<LocalContainer>& in, MPI_Vector<LocalContainer>& out);
131 double deltaPhi()
const{
return m_deltaPhi;}
132 const MPI_Vector<LocalContainer>&
hbm()
const {
135 const MPI_Vector<LocalContainer>&
hbp()
const {
138 const MPI_Vector<LocalContainer>&
sqrtG()
const {
141 const MPI_Vector<LocalContainer>&
sqrtGm()
const {
144 const MPI_Vector<LocalContainer>&
sqrtGp()
const {
147 const MPI_Vector<LocalContainer>&
bphi()
const {
150 const MPI_Vector<LocalContainer>&
bphiM()
const {
153 const MPI_Vector<LocalContainer>&
bphiP()
const {
156 const MPI_Vector<LocalContainer>&
bbm()
const {
159 const MPI_Vector<LocalContainer>&
bbo()
const {
162 const MPI_Vector<LocalContainer>&
bbp()
const {
165 const ProductMPIGeometry&
grid()
const{
return *m_g;}
167 template<
class BinaryOp,
class UnaryOp>
168 MPI_Vector<LocalContainer>
evaluate( BinaryOp f, UnaryOp g,
unsigned p0,
169 unsigned rounds)
const;
170 std::string
method()
const{
return m_interpolation_method;}
172 void ePlus(
enum whichMatrix which,
const MPI_Vector<LocalContainer>& in, MPI_Vector<LocalContainer>& out);
173 void eMinus(
enum whichMatrix which,
const MPI_Vector<LocalContainer>& in, MPI_Vector<LocalContainer>& out);
174 void zero(
enum whichMatrix which,
const MPI_Vector<LocalContainer>& in, MPI_Vector<LocalContainer>& out);
175 MPIDistMat<LocalIMatrix, CommunicatorXY> m_plus, m_zero, m_minus, m_plusT, m_minusT;
176 MPI_Vector<LocalContainer> m_hbm, m_hbp;
177 MPI_Vector<LocalContainer> m_G, m_Gm, m_Gp;
178 MPI_Vector<LocalContainer> m_bphi, m_bphiM, m_bphiP;
179 MPI_Vector<LocalContainer> m_bbm, m_bbp, m_bbo;
181 MPI_Vector<LocalContainer> m_left, m_right;
182 MPI_Vector<LocalContainer> m_limiter;
183 MPI_Vector<LocalContainer> m_ghostM, m_ghostP;
184 unsigned m_Nz, m_perp_size;
185 dg::bc m_bcx, m_bcy, m_bcz;
186 std::vector<MPI_Vector<dg::View<const LocalContainer>> > m_f;
187 std::vector<MPI_Vector<dg::View<LocalContainer>> > m_temp;
190 std::string m_interpolation_method;
191 unsigned m_coords2, m_sizeZ;
192#ifdef _DG_CUDA_UNAWARE_MPI
194 thrust::host_vector<double> m_send_buffer, m_recv_buffer;
196 bool m_have_adjoint =
false;
197 void updateAdjoint( )
201 m_have_adjoint =
true;
205template<
class MPIGeometry,
class LocalIMatrix,
class CommunicatorXY,
class LocalContainer>
206template <
class Limiter>
207Fieldaligned<MPIGeometry, MPIDistMat<LocalIMatrix, CommunicatorXY>, MPI_Vector<LocalContainer> >::Fieldaligned(
209 const MPIGeometry& grid,
211 unsigned mx,
unsigned my,
double deltaPhi, std::string interpolation_method,
bool benchmark
214 m_interpolation_method(interpolation_method)
217 MPI_Comm_rank( grid.communicator(), &rank);
218 int dims[3], periods[3], coords[3];
219 MPI_Cart_get( m_g->communicator(), 3, dims, periods, coords);
220 m_coords2 = coords[2], m_sizeZ = dims[2];
222 std::string inter_m, project_m, fine_m;
223 detail::parse_method( interpolation_method, inter_m, project_m, fine_m);
224 if( benchmark && rank==0) std::cout <<
"# Interpolation method: \""<<inter_m <<
"\" projection method: \""<<project_m<<
"\" fine grid \""<<fine_m<<
"\"\n";
226 if( (grid.bcx() ==
PER && bcx !=
PER) || (grid.bcx() !=
PER && bcx ==
PER) )
227 throw(
dg::Error(
dg::Message(_ping_)<<
"Fieldaligned: Got conflicting periodicity in x. The grid says "<<
bc2str(grid.bcx())<<
" while the parameter says "<<
bc2str(bcx)));
228 if( (grid.bcy() ==
PER && bcy !=
PER) || (grid.bcy() !=
PER && bcy ==
PER) )
229 throw(
dg::Error(
dg::Message(_ping_)<<
"Fieldaligned: Got conflicting boundary conditions in y. The grid says "<<
bc2str(grid.bcy())<<
" while the parameter says "<<
bc2str(bcy)));
230 m_Nz=grid.local().Nz(), m_bcz=grid.bcz(), m_bcx = bcx, m_bcy = bcy;
231 if( deltaPhi <=0) deltaPhi = grid.hz();
235 if( benchmark) t.
tic();
240 grid_equidist.set( 1, grid.global().gx().size(), grid.global().gy().size());
242 grid_magnetic->set( grid_transform->n() < 3 ? 4 : 7, grid_magnetic->Nx(), grid_magnetic->Ny());
244 grid_magnetic->global_geometry();
246 if( project_m !=
"dg" && fine_m ==
"dg")
248 unsigned rx = mx % grid.nx(), ry = my % grid.ny();
249 if( 0 != rx || 0 != ry)
251 if(rank==0)std::cerr <<
"#Warning: for projection method \"const\" mx and my must be multiples of nx and ny! Rounding up for you ...\n";
252 mx = mx + grid.nx() - rx;
253 my = my + grid.ny() - ry;
256 if( fine_m ==
"equi")
257 grid_fine = grid_equidist;
258 grid_fine.multiplyCellNumbers((
double)mx, (
double)my);
262 if(rank==0) std::cout <<
"# DS: High order grid gen took: "<<t.
diff()<<
"\n";
266 std::array<thrust::host_vector<double>,3> yp_trafo, ym_trafo, yp, ym;
267 thrust::host_vector<bool> in_boxp, in_boxm;
268 thrust::host_vector<double> hbp, hbm;
272 detail::integrate_all_fieldlines2d( vec, *global_grid_magnetic,
273 grid_transform->local(), yp_trafo, vol2d0.data(), hbp, in_boxp,
275 detail::integrate_all_fieldlines2d( vec, *global_grid_magnetic,
276 grid_transform->local(), ym_trafo, vol2d0.data(), hbm, in_boxm,
282 grid_transform->local(),
dg::NEU,
dg::NEU, grid_transform->n() < 3 ?
"cubic" :
"dg");
285 for(
int i=0; i<2; i++)
294 if(rank==0) std::cout <<
"# DS: Fieldline integration took: "<<t.
diff()<<
"\n";
301 if( project_m ==
"dg")
307 grid_transform->global(), bcx, bcy,
"dg");
310 if( project_m !=
"dg")
313 cusp::multiply( fine, multi, temp);
320 grid_transform->global(), bcx, bcy,
"dg");
323 if( project_m !=
"dg")
326 cusp::multiply( fine, multi, temp);
333 grid_transform->global(), bcx, bcy,
"dg");
336 if( project_m !=
"dg")
339 cusp::multiply( fine, multi, temp);
348 if( project_m ==
"dg")
355 grid_equidist.global(), bcx, bcy, inter_m);
356 cusp::multiply( multi, fine, temp);
359 if( project_m !=
"dg")
362 cusp::multiply( fine, multi, temp);
370 grid_equidist.global(), bcx, bcy, inter_m);
371 cusp::multiply( multi, fine, temp);
374 if( project_m !=
"dg")
377 cusp::multiply( fine, multi, temp);
385 grid_equidist.global(), bcx, bcy, inter_m);
386 cusp::multiply( multi, fine, temp);
389 if( project_m !=
"dg")
392 cusp::multiply( fine, multi, temp);
401 if(rank==0) std::cout <<
"# DS: Multiplication PI took: "<<t.
diff()<<
"\n";
404 dg::HVec hbphi( yp_trafo[2]), hbphiP(hbphi), hbphiM(hbphi);
410 for(
unsigned i=0; i<hbphiP.size(); i++)
412 hbphiP[i] = vec.
z()(yp_trafo[0][i], yp_trafo[1][i]);
413 hbphiM[i] = vec.
z()(ym_trafo[0][i], ym_trafo[1][i]);
420 for(
unsigned i=0; i<yp_trafo[0].size(); i++)
423 yp_trafo[1][i], *global_grid_magnetic);
425 ym_trafo[1][i], *global_grid_magnetic);
442 m_f =
dg::split( (
const MPI_Vector<LocalContainer>&)m_hbm, grid);
447 thrust::host_vector<double> bbm( in_boxp.size(),0.), bbo(bbm), bbp(bbm);
448 for(
unsigned i=0; i<in_boxp.size(); i++)
450 if( !in_boxp[i] && !in_boxm[i])
452 else if( !in_boxp[i] && in_boxm[i])
454 else if( in_boxp[i] && !in_boxm[i])
462 m_deltaPhi = deltaPhi;
465 m_perp_size = grid_transform->local().size();
468 m_ghostM = m_ghostP = m_right = m_left;
469#ifdef _DG_CUDA_UNAWARE_MPI
470 m_recv_buffer = m_send_buffer = m_ghostP.data();
475template<
class G,
class M,
class C,
class container>
476void Fieldaligned<G, MPIDistMat<M,C>, MPI_Vector<container> >::operator()(
enum
478 MPI_Vector<container>& fe)
488template<
class G,
class M,
class C,
class container>
489void Fieldaligned<G, MPIDistMat<M,C>, MPI_Vector<container> >
::zero(
enum whichMatrix which,
const MPI_Vector<container>& f, MPI_Vector<container>& f0)
494 for(
unsigned i0=0; i0<m_Nz; i0++)
502 if( ! m_have_adjoint) updateAdjoint( );
507 if( ! m_have_adjoint) updateAdjoint( );
512 if ( m_interpolation_method !=
"dg" )
522template<
class G,
class M,
class C,
class container>
523void Fieldaligned<G,MPIDistMat<M,C>, MPI_Vector<container> >::ePlus(
enum whichMatrix which,
const MPI_Vector<container>& f, MPI_Vector<container>& fpe )
528 for(
unsigned i0=0; i0<m_Nz; i0++)
530 unsigned ip = (i0==m_Nz-1) ? 0:i0+1;
535 if( ! m_have_adjoint) updateAdjoint( );
543 unsigned i0 = m_Nz-1;
544#ifdef _DG_CUDA_UNAWARE_MPI
545 thrust::copy( m_temp[i0].data().cbegin(), m_temp[i0].data().cend(), m_send_buffer.begin());
546 detail::sendBackward( m_send_buffer, m_recv_buffer, m_g->communicator());
547 thrust::copy( m_recv_buffer.cbegin(), m_recv_buffer.cend(), m_temp[i0].data().begin());
549 detail::sendBackward( m_temp[i0].data(), m_ghostM.data(), m_g->communicator());
556 if( m_bcz !=
dg::PER && m_g->local().z1() == m_g->global().z1())
568template<
class G,
class M,
class C,
class container>
569void Fieldaligned<G,MPIDistMat<M,C>, MPI_Vector<container> >::eMinus(
enum whichMatrix which,
const MPI_Vector<container>& f, MPI_Vector<container>& fme )
572 MPI_Comm_rank(m_g->communicator(), &rank);
576 for(
unsigned i0=0; i0<m_Nz; i0++)
578 unsigned im = (i0==0) ? m_Nz-1:i0-1;
581 if( ! m_have_adjoint) updateAdjoint( );
592#ifdef _DG_CUDA_UNAWARE_MPI
593 thrust::copy( m_temp[i0].data().cbegin(), m_temp[i0].data().cend(), m_send_buffer.begin());
594 detail::sendForward( m_send_buffer, m_recv_buffer, m_g->communicator());
595 thrust::copy( m_recv_buffer.cbegin(), m_recv_buffer.cend(), m_temp[i0].data().begin());
597 detail::sendForward( m_temp[i0].data(), m_ghostP.data(), m_g->communicator());
604 if( m_bcz !=
dg::PER && m_g->local().z0() == m_g->global().z0())
616template<
class G,
class M,
class C,
class container>
617template<
class BinaryOp,
class UnaryOp>
618MPI_Vector<container> Fieldaligned<G,MPIDistMat<M,C>, MPI_Vector<container> >
::evaluate( BinaryOp binary, UnaryOp unary,
unsigned p0,
unsigned rounds)
const
622 assert( p0 < m_g->global().Nz());
624 MPI_Vector<container> init2d =
dg::pullback( binary, *g2d);
626 unsigned globalNz = m_g->global().Nz();
628 MPI_Vector<container> temp(init2d), tempP(init2d), tempM(init2d);
630 std::vector<MPI_Vector<container> > plus2d(globalNz, zero2d), minus2d(plus2d), result(plus2d);
631 unsigned turns = rounds;
632 if( turns ==0) turns++;
634 for(
unsigned r=0; r<turns; r++)
635 for(
unsigned i0=0; i0<globalNz; i0++)
639 unsigned rep = r*globalNz + i0;
640 for(
unsigned k=0; k<rep; k++)
657 for(
unsigned i0=0; i0<m_Nz; i0++)
659 int idx = (int)(i0+m_coords2*m_Nz) - (int)p0;
661 result[i0] = plus2d[idx];
663 result[i0] = minus2d[abs(idx)];
664 thrust::copy( result[i0].data().begin(), result[i0].data().end(),
665 vec3d.data().begin() + i0*m_perp_size);
670 for(
unsigned i0=0; i0<globalNz; i0++)
672 unsigned revi0 = (globalNz - i0)%globalNz;
677 for(
unsigned i0=0; i0<m_Nz; i0++)
679 int idx = ((int)i0 + m_coords2*m_Nz -(
int)p0 + globalNz)%globalNz;
680 thrust::copy( result[idx].data().begin(), result[idx].data().end(),
681 vec3d.data().begin() + i0*m_perp_size);
694template<
class BinaryOp,
class UnaryOp>
698 const BinaryOp& binary,
699 const UnaryOp& unary,
704 unsigned Nz = grid.
Nz();
709 std::vector<dg::MHVec> plus2d(Nz, tempP), minus2d(plus2d), result(plus2d);
711 std::array<dg::HVec,3> yy0{
715 dg::geo::detail::DSFieldCylindrical3 cyl_field(vec);
716 double deltaPhi = grid.
hz();
717 double phiM0 = 0., phiP0 = 0.;
718 unsigned turns = rounds;
719 if( turns == 0) turns++;
720 for(
unsigned r=0; r<turns; r++)
721 for(
unsigned i0=0; i0<Nz; i0++)
723 unsigned rep = r*Nz + i0;
725 tempM = tempP = init2d;
729 "Dormand-Prince-7-4-5", std::array<double,3>{0,0,0});
732 for(
unsigned i=0; i<g2d->local().size(); i++)
735 double phiM1 = phiM0 + deltaPhi;
737 coords0{yy0[0][i],yy0[1][i],yy0[2][i]}, coords1;
738 odeint.integrate_in_domain( phiM0, coords0, phiM1,
739 coords1, deltaPhi, g2d->global(), eps);
740 yy1[0][i] = coords1[0], yy1[1][i] = coords1[1], yy1[2][i] =
742 tempM.data()[i] = binary( yy1[0][i], yy1[1][i]);
745 double phiP1 = phiP0 - deltaPhi;
746 coords0 = std::array<double,3>{xx0[0][i],xx0[1][i],xx0[2][i]};
747 odeint.integrate_in_domain( phiP0, coords0, phiP1,
748 coords1, -deltaPhi, g2d->global(), eps);
749 xx1[0][i] = coords1[0], xx1[1][i] = coords1[1], xx1[2][i] =
751 tempP.
data()[i] = binary( xx1[0][i], xx1[1][i]);
753 std::swap( yy0, yy1);
754 std::swap( xx0, xx1);
764 int dims[3], periods[3], coords[3];
765 MPI_Cart_get( grid.
communicator(), 3, dims, periods, coords);
766 unsigned coords2 = coords[2];
769 for(
unsigned i0=0; i0<grid.
local().Nz(); i0++)
771 int idx = (int)(i0+coords2*grid.
local().Nz()) - (
int)p0;
773 result[i0] = plus2d[idx];
775 result[i0] = minus2d[abs(idx)];
776 thrust::copy( result[i0].data().begin(), result[i0].data().end(),
777 vec3d.
data().begin() + i0*g2d->local().size());
782 for(
unsigned i0=0; i0<Nz; i0++)
784 unsigned revi0 = (Nz - i0)%Nz;
789 for(
unsigned i0=0; i0<grid.
local().Nz(); i0++)
791 int idx = ((int)i0 +coords2*grid.
local().Nz()-(int)p0 + Nz)%Nz;
793 thrust::copy( result[idx].data().begin(), result[idx].data().end(),
794 vec3d.
data().begin() + i0*g2d->local().size());
void assign(const from_ContainerType &from, ContainerType &to, Params &&... ps)
static DG_DEVICE double cooY2d(double x, double y)
static DG_DEVICE double zero(double x)
static DG_DEVICE double cooX2d(double x, double y)
void copy(const ContainerTypeIn &source, ContainerTypeOut &target)
void axpby(get_value_type< ContainerType > alpha, const ContainerType1 &x, get_value_type< ContainerType > beta, ContainerType &y)
void scal(ContainerType &x, get_value_type< ContainerType > alpha)
void evaluate(ContainerType &y, BinarySubroutine f, Functor g, const ContainerType0 &x0, const ContainerTypes &...xs)
void pointwiseDot(get_value_type< ContainerType > alpha, const ContainerType1 &x1, const ContainerType2 &x2, get_value_type< ContainerType > beta, ContainerType &y)
void transfer(const MatrixType &x, AnotherMatrixType &y)
void symv(MatrixType &&M, const ContainerType1 &x, ContainerType2 &y)
static std::string bc2str(bc bcx)
thrust::host_vector< real_type > evaluate(UnaryOp f, const RealGrid1d< real_type > &g)
whichMatrix
Enum for the use in Fieldaligned.
Definition: fieldaligned.h:17
ONE FullLimiter
Full Limiter means there is a limiter everywhere.
Definition: fieldaligned.h:31
MPI_Vector< thrust::host_vector< double > > fieldaligned_evaluate(const aProductMPIGeometry3d &grid, const CylindricalVectorLvl0 &vec, const BinaryOp &binary, const UnaryOp &unary, unsigned p0, unsigned rounds, double eps=1e-5)
Evaluate a 2d functor and transform to all planes along the fieldlines (MPI Version)
Definition: mpi_fieldaligned.h:695
@ zeroPlusT
transposed plus interpolation in the current plane
Definition: fieldaligned.h:24
@ einsMinus
minus interpolation in previous plane
Definition: fieldaligned.h:20
@ einsMinusT
transposed minus interpolation in next plane
Definition: fieldaligned.h:21
@ zeroMinusT
transposed minus interpolation in the current plane
Definition: fieldaligned.h:25
@ einsPlusT
transposed plus interpolation in previous plane
Definition: fieldaligned.h:19
@ zeroForw
from dg to transformed coordinates
Definition: fieldaligned.h:26
@ zeroMinus
minus interpolation in the current plane
Definition: fieldaligned.h:23
@ zeroPlus
plus interpolation in the current plane
Definition: fieldaligned.h:22
@ einsPlus
plus interpolation in next plane
Definition: fieldaligned.h:18
MPI_Vector< thrust::host_vector< real_type > > weights(const aRealMPITopology2d< real_type > &g)
cusp::coo_matrix< int, real_type, cusp::host_memory > interpolation(const thrust::host_vector< real_type > &x, const RealGrid1d< real_type > &g, dg::bc bcx=dg::NEU, std::string method="dg")
real_type interpolate(dg::space sp, const thrust::host_vector< real_type > &v, real_type x, const RealGrid1d< real_type > &g, dg::bc bcx=dg::NEU)
dg::MIHMatrix_t< real_type > projection(const aRealMPITopology2d< real_type > &g_new, const aRealMPITopology2d< real_type > &g_old, std::string method="dg")
CylindricalVectorLvl1 createBHat(const TokamakMagneticField &mag)
Contravariant components of the magnetic unit vector field and its Divergence and derivative in cylin...
Definition: magnetic_field.h:931
thrust::host_vector< real_type > forward_transform(const thrust::host_vector< real_type > &in, const aRealTopology2d< real_type > &g)
void transpose(unsigned nx, unsigned ny, const ContainerType &in, ContainerType &out)
bool is_same(double x, double y, double eps=1e-15)
dg::MIHMatrix_t< real_type > convert(const dg::IHMatrix_t< real_type > &global, const ConversionPolicy &policy)
dg::IHMatrix_t< real_type > convertGlobal2LocalRows(const dg::IHMatrix_t< real_type > &global, const ConversionPolicy &policy)
thrust::host_vector< real_type > pullback(const Functor &f, const aRealGeometryX2d< real_type > &g)
void assign3dfrom2d(const thrust::host_vector< real_type > &in2d, Container &out, const aRealTopology3d< real_type > &grid)
dg::IHMatrix_t< real_type > backproject(const RealGrid1d< real_type > &g)
dg::IHMatrix_t< real_type > inv_backproject(const RealGrid1d< real_type > &g)
void split(SharedContainer &in, std::vector< View< SharedContainer > > &out, const aRealTopology3d< real_type > &grid)
ContainerType volume(const SparseTensor< ContainerType > &t)
typename TensorTraits< std::decay_t< Vector > >::execution_policy get_execution_policy
IHMatrix_t< double > IHMatrix
thrust::host_vector< double > HVec
const container & data() const
MPI_Comm communicator() const
const RealGrid3d< real_type > & local() const
aRealMPIGeometry2d< real_type > * perp_grid() const
Definition: fluxfunctions.h:412
This struct bundles a vector field and its divergence.
Definition: fluxfunctions.h:440
const CylindricalFunctor & z() const
z-component of the vector
Definition: fluxfunctions.h:470
dg::bc bcx() const
Definition: fieldaligned.h:484
const container & hbp() const
Distance between the planes .
Definition: fieldaligned.h:561
const container & bphi() const
bphi
Definition: fieldaligned.h:581
const container & bbp() const
Mask plus, 1 if fieldline intersects wall in plus direction but not in minus direction,...
Definition: fieldaligned.h:606
container evaluate(BinaryOp binary, UnaryOp unary, unsigned p0, unsigned rounds) const
Evaluate a 2d functor and transform to all planes along the fieldline
const container & sqrtG() const
Volume form (including weights) .
Definition: fieldaligned.h:566
void operator()(enum whichMatrix which, const container &in, container &out)
Apply the interpolation to three-dimensional vectors.
const container & sqrtGm() const
Volume form on minus plane (including weights) .
Definition: fieldaligned.h:571
void set_boundaries(dg::bc bcz, double left, double right)
Set boundary conditions in the limiter region.
Definition: fieldaligned.h:501
std::string method() const
Return the interpolation_method string given in the constructor.
Definition: fieldaligned.h:671
const container & hbm() const
Distance between the planes and the boundary .
Definition: fieldaligned.h:556
const container & bphiM() const
bphi on minus plane
Definition: fieldaligned.h:586
dg::bc bcy() const
Definition: fieldaligned.h:487
double deltaPhi() const
Definition: fieldaligned.h:553
Fieldaligned()
do not allocate memory; no member call except construct is valid
Definition: fieldaligned.h:436
void construct(Params &&...ps)
Perfect forward parameters to one of the constructors.
Definition: fieldaligned.h:478
const container & bbo() const
Mask both, 1 if fieldline intersects wall in plus direction and in minus direction,...
Definition: fieldaligned.h:601
const container & bbm() const
Mask minus, 1 if fieldline intersects wall in minus direction but not in plus direction,...
Definition: fieldaligned.h:596
const container & sqrtGp() const
Volume form on plus plane (including weights) .
Definition: fieldaligned.h:576
const container & bphiP() const
bphi on plus plane
Definition: fieldaligned.h:591
const ProductGeometry & grid() const
Grid used for construction.
Definition: fieldaligned.h:610
A tokamak field as given by R0, Psi and Ipol plus Meta-data like shape and equilibrium.
Definition: magnetic_field.h:162