11 #ifndef INTERPOLATOR_H
12 #define INTERPOLATOR_H
35 template <
class PT,
unsigned Dim,
class M>
39 return mesh.getCellContaining(ppos);
42 template <
class PT,
unsigned Dim,
class M>
46 return mesh.getNearestVertex(ppos);
49 template <
class PT,
unsigned Dim,
class M>
53 std::vector<NDIndex<Dim> > ngp;
54 ngp.push_back(mesh.getCellContaining(ppos));
55 ngp.push_back(mesh.getNearestVertex(ppos));
60 template <
class PT,
unsigned Dim,
class M>
64 pos = mesh.getCellPosition(indices);
68 template <
class PT,
unsigned Dim,
class M>
72 pos = mesh.getVertexPosition(indices);
76 template <
class PT,
unsigned Dim,
class M>
84 for (
unsigned int d = 0; d <
Dim; ++ d) {
86 pos[d](d) = cell_pos(d);
93 template <
class PT,
unsigned Dim,
class M>
98 for (
unsigned d=0; d<
Dim; ++d) vp[d] = gp[d] + 1;
99 delta = mesh.getDeltaCell(vp);
103 template <
class PT,
unsigned Dim,
class M>
107 delta = mesh.getDeltaVertex(gp);
111 template <
class PT,
unsigned Dim,
class M>
116 for (
unsigned d=0; d<
Dim; ++d) vp[d] = (gp[0])[d] + 1;
118 delta[0] = mesh.getDeltaCell(vp);
119 delta[1] = mesh.getDeltaVertex(gp[1]);
127 template <
class T,
unsigned Dim,
class InterpolatorType>
131 template <
class T,
unsigned Dim>
137 template <
class T,
unsigned Dim>
140 o <<
"(" <<
c.Index_m <<
"," <<
c.Delta_m <<
")";
146 template <
class T,
unsigned Dim>
155 template <
class T,
unsigned Dim>
162 template <
class T,
unsigned Dim>
166 for (
unsigned int i=0; i <
Dim; ++i)
167 offset[i] =
c.Offset_m[i];
168 o <<
"(" <<
c.Index_m <<
"," <<
c.Delta_m <<
"," << offset <<
")";
181 template <
class T,
unsigned Dim>
186 for (lf_i = f.
begin_if(); lf_i != lf_end; ++lf_i) {
195 for (lf_i = f.
begin_if(); lf_i != lf_end; ++lf_i) {
207 ERRORMSG(
"Interpolator::getFieldIter: attempt to access non-local index");
209 ERRORMSG(
"Dumping local owned and allocated domains:" <<
endl);
211 for ( lf_i = f.
begin_if(); lf_i != lf_end ; ++lf_i, ++lfc ) {
220 return (*(*(f.
begin_if())).second).begin();
NDIndex< Dim > FindNGP(const M &mesh, const Vektor< PT, Dim > &ppos, CenteringTag< Cell >)
std::ostream & operator<<(std::ostream &o, const CacheData1< T, Dim > &c)
void FindDelta(Vektor< PT, Dim > &delta, const M &mesh, const NDIndex< Dim > &gp, CenteringTag< Cell >)
void FindPos(Vektor< PT, Dim > &pos, const M &mesh, const NDIndex< Dim > &indices, CenteringTag< Cell >)
Inform & endl(Inform &inf)
constexpr double c
The velocity of light in m/s.
ac_id_larray::const_iterator const_iterator_if
Layout_t & getLayout() const
const NDIndex< Dim > & getOwned() const
const NDIndex< Dim > & getAllocated() const
const iterator & begin() const
static CompressedBrickIterator< T, Dim > getFieldIter(const BareField< T, Dim > &f, const NDIndex< Dim > &pt)
static void abort(const char *=0)