48template<
unsigned Dim,
class Mesh>
56 for (
unsigned int d=0; d<
Dim; d++)
57 ndi[d] =
Index(mesh.gridSizes[d] - 1);
62template<
unsigned Dim,
class Mesh>
70 for (
unsigned int d=0; d<
Dim; d++)
71 ndi[d] =
Index(mesh.gridSizes[d]);
76template<
unsigned Dim,
class Mesh>
84 for (
unsigned int d=0; d<
Dim; d++)
85 ndi[d] =
Index(mesh.gridSizes[d]);
104 unsigned npts[
Dim], nGridPts;
106 for (d=0; d<
Dim; d++) {
107 nGridPts = mesh.gridSizes[d];
109 for (
c=0;
c<NComponents;
c++) {
110 if (CE[
c + d*NComponents] ==
CELL) {
111 npts[d] =
std::max(npts[d], (nGridPts - 1));
113 npts[d] =
std::max(npts[d], nGridPts);
117 for (d=0; d<
Dim; d++) ndi[d] =
Index(npts[d]);
118 cfl.initialize(ndi, edt, vnodes);
130template<
unsigned Dim,
class Mesh>
135 unsigned* vnodesAlongDirection,
140 for (
unsigned int d=0; d<
Dim; d++) ndi[d] =
Index(mesh.gridSizes[d] - 1);
141 cfl.
initialize(ndi, edt, vnodesAlongDirection, recurse, vnodes);
145template<
unsigned Dim,
class Mesh>
150 unsigned* vnodesAlongDirection,
155 for (
unsigned int d=0; d<
Dim; d++) ndi[d] =
Index(mesh.gridSizes[d]);
156 cfl.
initialize(ndi, edt, vnodesAlongDirection, recurse, vnodes);
160template<
unsigned Dim,
class Mesh>
165 unsigned* vnodesAlongDirection,
170 for (
unsigned int d=0; d<
Dim; d++) ndi[d] =
Index(mesh.gridSizes[d]);
171 cfl.
initialize(ndi, edt, vnodesAlongDirection, recurse, vnodes);
176 unsigned NComponents>
182 unsigned* vnodesAlongDirection,
191 unsigned npts[
Dim], nGridPts;
193 for (d=0; d<
Dim; d++) {
194 nGridPts = mesh.gridSizes[d];
196 for (
c=0;
c<NComponents;
c++) {
197 if (CE[
c + d*NComponents] ==
CELL) {
198 npts[d] =
max(npts[d], (nGridPts - 1));
200 npts[d] =
max(npts[d], nGridPts);
204 for (d=0; d<
Dim; d++) ndi[d] =
Index(npts[d]);
205 cfl.initialize(ndi, edt, vnodesAlongDirection, recurse, vnodes);
212template<
unsigned Dim,
class Mesh>
222 for (
unsigned int d=0; d<
Dim; d++) ndi[d] =
Index(mesh.gridSizes[d] - 1);
223 cfl.
initialize(ndi, dombegin, domend, nbegin, nend);
227template<
unsigned Dim,
class Mesh>
237 for (
unsigned int d=0; d<
Dim; d++) ndi[d] =
Index(mesh.gridSizes[d]);
238 cfl.
initialize(ndi, dombegin, domend, nbegin, nend);
242template<
unsigned Dim,
class Mesh>
252 for (
unsigned int d=0; d<
Dim; d++) ndi[d] =
Index(mesh.gridSizes[d]);
253 cfl.
initialize(ndi, dombegin, domend, nbegin, nend);
258 unsigned NComponents>
272 unsigned npts[
Dim], nGridPts;
274 for (d=0; d<
Dim; d++) {
275 nGridPts = mesh.gridSizes[d];
277 for (
c=0;
c<NComponents;
c++) {
278 if (CE[
c + d*NComponents] ==
CELL) {
279 npts[d] =
max(npts[d], (nGridPts - 1));
281 npts[d] =
max(npts[d], nGridPts);
287 for (d=0; d<
Dim; d++) ndi[d] =
Index(npts[d]);
288 cfl.initialize(ndi, dombegin, domend, nbegin, nend);
304template<
unsigned Dim,
class Mesh,
class Centering>
312 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
318template<
unsigned Dim,
class Mesh,
class Centering>
326 "Number of arguments does not match dimension of CenteredFieldLayout!!");
328 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
331template<
unsigned Dim,
class Mesh,
class Centering>
339 "Number of arguments does not match dimension of CenteredFieldLayout!!");
341 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
343 edt[0] = p1; edt[1] = p2;
346template<
unsigned Dim,
class Mesh,
class Centering>
354 "Number of arguments does not match dimension of CenteredFieldLayout!!");
356 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
358 edt[0] = p1; edt[1] = p2; edt[2] = p3;
361template<
unsigned Dim,
class Mesh,
class Centering>
369 "Number of arguments does not match dimension of CenteredFieldLayout!!");
371 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
373 edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4;
376template<
unsigned Dim,
class Mesh,
class Centering>
385 "Number of arguments does not match dimension of CenteredFieldLayout!!");
387 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
389 edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4; edt[4] = p5;
392template<
unsigned Dim,
class Mesh,
class Centering>
401 "Number of arguments does not match dimension of CenteredFieldLayout!!");
403 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
405 edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4; edt[4] = p5; edt[5] = p6;
417template<
unsigned Dim,
class Mesh,
class Centering>
421 unsigned* vnodesAlongDirection,
427 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
431template<
unsigned Dim,
class Mesh,
class Centering>
441 "Number of arguments does not match dimension of CenteredFieldLayout!!");
443 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
446template<
unsigned Dim,
class Mesh,
class Centering>
450 unsigned vnodes1,
unsigned vnodes2,
456 "Number of arguments does not match dimension of CenteredFieldLayout!!");
458 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
460 edt[0] = p1; edt[1] = p2;
462 vad[0] = vnodes1; vad[1] = vnodes2;
465template<
unsigned Dim,
class Mesh,
class Centering>
469 unsigned vnodes1,
unsigned vnodes2,
unsigned vnodes3,
475 "Number of arguments does not match dimension of CenteredFieldLayout!!");
477 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
479 edt[0] = p1; edt[1] = p2; edt[2] = p3;
481 vad[0] = vnodes1; vad[1] = vnodes2; vad[2] = vnodes3;
484template<
unsigned Dim,
class Mesh,
class Centering>
488 unsigned vnodes1,
unsigned vnodes2,
unsigned vnodes3,
495 "Number of arguments does not match dimension of CenteredFieldLayout!!");
497 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
499 edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4;
501 vad[0] = vnodes1; vad[1] = vnodes2; vad[2] = vnodes3;
505template<
unsigned Dim,
class Mesh,
class Centering>
510 unsigned vnodes1,
unsigned vnodes2,
unsigned vnodes3,
511 unsigned vnodes4,
unsigned vnodes5,
517 "Number of arguments does not match dimension of CenteredFieldLayout!!");
519 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
521 edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4; edt[4] = p5;
523 vad[0] = vnodes1; vad[1] = vnodes2; vad[2] = vnodes3;
524 vad[3] = vnodes4; vad[4] = vnodes5;
527template<
unsigned Dim,
class Mesh,
class Centering>
532 unsigned vnodes1,
unsigned vnodes2,
unsigned vnodes3,
533 unsigned vnodes4,
unsigned vnodes5,
unsigned vnodes6,
539 "Number of arguments does not match dimension of CenteredFieldLayout!!");
541 "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
543 edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4; edt[4] = p5; edt[5] = p6;
545 vad[0] = vnodes1; vad[1] = vnodes2; vad[2] = vnodes3;
546 vad[3] = vnodes4; vad[4] = vnodes5; vad[5] = vnodes6;
554template<
unsigned Dim,
class Mesh,
class Centering>
void centeredInitialize(CenteredFieldLayout< Dim, Mesh, Cell > &cfl, const Mesh &mesh, e_dim_tag *edt, int vnodes)
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
constexpr double c
The velocity of light in m/s.
void initialize(const Index &i1, e_dim_tag p1=PARALLEL, int vnodes=-1)
CenteredFieldLayout(Mesh &mesh, e_dim_tag *p=0, int vnodes=-1)