11 #ifndef INTERPOLATOR_H
12 #define INTERPOLATOR_H
43 template <
class PT,
unsigned Dim,
class M>
47 return mesh.getCellContaining(ppos);
50 template <
class PT,
unsigned Dim,
class M>
54 return mesh.getNearestVertex(ppos);
57 template <
class PT,
unsigned Dim,
class M>
61 std::vector<NDIndex<Dim> > ngp;
62 ngp.push_back(mesh.getCellContaining(ppos));
63 ngp.push_back(mesh.getNearestVertex(ppos));
68 template <
class PT,
unsigned Dim,
class M>
72 pos = mesh.getCellPosition(indices);
76 template <
class PT,
unsigned Dim,
class M>
80 pos = mesh.getVertexPosition(indices);
84 template <
class PT,
unsigned Dim,
class M>
92 for (
unsigned int d = 0; d <
Dim; ++ d) {
94 pos[d](d) = cell_pos(d);
101 template <
class PT,
unsigned Dim,
class M>
106 for (
unsigned d=0; d<
Dim; ++d) vp[d] = gp[d] + 1;
107 delta = mesh.getDeltaCell(vp);
111 template <
class PT,
unsigned Dim,
class M>
115 delta = mesh.getDeltaVertex(gp);
119 template <
class PT,
unsigned Dim,
class M>
124 for (
unsigned d=0; d<
Dim; ++d) vp[d] = (gp[0])[d] + 1;
126 delta[0] = mesh.getDeltaCell(vp);
127 delta[1] = mesh.getDeltaVertex(gp[1]);
135 template <
class T,
unsigned Dim,
class InterpolatorType>
139 template <
class T,
unsigned Dim>
145 template <
class T,
unsigned Dim>
146 inline std::ostream &operator<<(std::ostream &o, const CacheData1<T,Dim> &
c)
148 o <<
"(" <<
c.Index_m <<
"," <<
c.Delta_m <<
")";
154 template <
class T,
unsigned Dim>
163 template <
class T,
unsigned Dim>
170 template <
class T,
unsigned Dim>
171 inline std::ostream &operator<<(std::ostream &o, const CacheDataCIC<T,Dim> &
c)
174 for (
unsigned int i=0; i <
Dim; ++i)
175 offset[i] =
c.Offset_m[i];
176 o <<
"(" <<
c.Index_m <<
"," <<
c.Delta_m <<
"," << offset <<
")";
189 template <
class T,
unsigned Dim>
194 for (lf_i = f.
begin_if(); lf_i != lf_end; ++lf_i) {
203 for (lf_i = f.
begin_if(); lf_i != lf_end; ++lf_i) {
215 ERRORMSG(
"Interpolator::getFieldIter: attempt to access non-local index");
217 ERRORMSG(
"Dumping local owned and allocated domains:" <<
endl);
219 for ( lf_i = f.
begin_if(); lf_i != lf_end ; ++lf_i, ++lfc ) {
228 return (*(*(f.
begin_if())).second).begin();
285 #endif // INTERPOLATOR_H
static void abort(const char *=0, int exitcode=(-1))
Layout_t & getLayout() const
const NDIndex< Dim > & getOwned() const
const iterator & begin() const
constexpr double c
The velocity of light in m/s.
void FindDelta(Vektor< PT, Dim > &delta, const M &mesh, const NDIndex< Dim > &gp, CenteringTag< Cell >)
const NDIndex< Dim > & getAllocated() const
void FindPos(Vektor< PT, Dim > &pos, const M &mesh, const NDIndex< Dim > &indices, CenteringTag< Cell >)
static CompressedBrickIterator< T, Dim > getFieldIter(const BareField< T, Dim > &f, const NDIndex< Dim > &pt)
ac_id_larray::const_iterator const_iterator_if
NDIndex< Dim > FindNGP(const M &mesh, const Vektor< PT, Dim > &ppos, CenteringTag< Cell >)
Inform & endl(Inform &inf)