Chombo + EB  3.2
NodeFArrayBox.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 // NodeFArrayBox.H
12 // adapted from dMartin/Chombo-IAMR/util/FluxBox.H
13 // by Dan Martin, Fri, Jan 14, 2000
14 // petermc, 1 Nov 2000
15 // 8 Jan 2001 added
16 
17 #ifndef _NODEFARRAYBOX_H_
18 #define _NODEFARRAYBOX_H_
19 
20 #include "FArrayBox.H"
21 #include "NamespaceHeader.H"
22 
23 /// A wrapper for an FArrayBox to contain NODE-centered data.
24 /** This is a class to contain NODE-centered data on a box.<br>
25  <b>Question</b>: Why not just use NODE-centered FArrayBox?<br>
26  <b>Answer</b>: We want to use LevelData<NodeFArrayBox>,
27  which requires that the underlying BoxLayout be a DisjointBoxLayout.
28  Adjacent NODE-centered boxes intersect, but adjacent CELL-centered
29  boxes do not.<br>
30  The underlying DisjointBoxLayout will be CELL-centered.
31 
32  In a LevelData<NodeFArrayBox>, some of the grids may share nodes.
33  The data on shared nodes must be the same.
34 
35  Example: A four-grid layout is shown on the left. As shown on
36  the right, the nodes marked "2" are shared by two grids, and
37  those marked "3" are shared by three grids.
38  <pre>
39 : : :
40 : +-----+ : YYYY--+ :
41 : | | : | | :
42 : | A | : | A | :
43 : | | : | | :
44 : +---+--+--+---+ : +---2223222---+ :
45 : | | | : | 2 | :
46 : | B | C | : | B 2 C | :
47 : | | | : | 2 | :
48 : +---+------+------+ : X---22222223------X :
49 : | | : | | :
50 : | D | : | D | :
51 : | | : | | :
52 : +----------+ : +-------YYYY :
53 : : :
54  </pre>
55  Additional nodes may be shared if the boxes extend to the faces
56  of a domain that is periodic in one or more directions.
57  In the example above, these nodes are marked "X" and "Y".<br>
58  Horizontally periodic domain: node "X" shared by two grids, C and D.<br>
59  Vertically periodic domain: nodes "Y" shared by two grids, A and D.
60 
61  <b>Using copyTo:</b>
62 
63  One of the most useful features of LevelData<NodeFArrayBox> is the
64  copyTo() function. THE copyTo() FUNCTION MUST BE USED WITH CAUTION
65  if the source and destination have different layouts.
66 
67  Consider an example where A and B are on layouts of one box
68  each, and these two boxes abut:
69  <pre>
70  +-------+
71  | |
72  | A |
73  | |
74  =========
75  | |
76  | B |
77  | |
78  +-------+
79  </pre>
80  If we do A.copyTo(B), then the data on the nodes of the interface
81  (marked "=") are NOT copied, because the underlying CELL-centered
82  DisjointBoxLayouts of the LevelDatas do not intersect.
83 
84  In general, doing <tt>src.copyTo(dest)</tt>:
85  if LevelData<NodeFArrayBox> <tt>src</tt> and
86  LevelData<NodeFArrayBox> <tt>dest</tt>
87  do NOT have identical underlying boxes in their layouts,
88  then <tt>src.copyTo(dest)</tt> will NOT copy the interface nodes.
89 
90  Here are two different ways to make sure the interface nodes are copied:
91 
92  1. Do copyTo to a BoxLayoutData<NodeFArrayBox> defined on
93  the BoxLayout of <tt>dest</tt> with each box expanded
94  by 1 in each dimension.
95  That is:
96 <pre>
97  BoxLayout destExpandedLayout;
98  destExpandedLayout.deepCopy(dest.disjointBoxLayout());
99  destExpandedLayout.grow(1);
100  destExpandedLayout.closeNoSort();
101  src.copyTo(destExpanded);
102  for (DataIterator dit = dest.dataIterator(); dit.ok(); ++dit)
103  {
104  dest[dit].copy(destExpanded[dit]);
105  }
106 </pre>
107 
108  2. Define <tt>src</tt> with ghost vector IntVect::Unit, and in copyTo,
109  use a Copier with ghost vector IntVect::Unit.
110  That is:
111 <pre>
112  Copier myCopier;
113  myCopier.ghostDefine(src.disjointBoxLayout(),
114  dest.disjointBoxLayout(),
115  src.disjointBoxLayout().physDomain(),
116  IntVect::Unit);
117  src.copyTo(dest, myCopier);
118 </pre>
119  For this to work, <tt>src</tt> must have been defined with ghost vector
120  IntVect::Unit (at least).
121 */
123 {
124 
125 public:
126 
127  /**
128  \name Constructors, destructor and defines
129  */
130  /*@{*/
131 
132  ///
133  /** Default constructor. User must subsequently call define().
134  */
135  NodeFArrayBox();
136 
137  ///
138  /** Constructs NodeFArrayBox on CELL-centered box <i>a_bx</i>
139  with <i>a_nComp</i>. If a_alias is not null this oject does not delete it in the destructor.
140  */
141  NodeFArrayBox(const Box& a_bx, int a_nComp, Real* a_alias = NULL);
142 
143  ///
144  /**Constructs NodeFArrayBox on CELL-centered box <i>a_bx</i> for just a scalar.
145  */
146  NodeFArrayBox(const Box& a_bx) {define(a_bx,1);}
147  ///
148  /** Constructs an aliased NodeFArrayBox.
149  */
150  NodeFArrayBox(const Interval& a_comps, NodeFArrayBox& a_original);
151 
152  NodeFArrayBox(NodeFArrayBox&& a_in)=default;
153  NodeFArrayBox& operator=(NodeFArrayBox&& a_in)=default;
154  ///
155  /** Destructor.
156  */
157  ~NodeFArrayBox();
158 
159  ///
160  /** Defines NodeFArrayBox on CELL-centered box <i>a_bx</i>
161  with <i>a_nComp</i> components. If called more than once
162  on the same instance, the box and FAB will be resize()d.
163  */
164  void define(const Box& a_bx, int a_nComp=1);
165 
166  ///
167  /** alias Defines NodeFArrayBox on CELL-centered box <i>a_bx</i>
168  with <i>a_nComp</i> components. If called more than once
169  on the same instance, the box and FAB will be resize()d.
170  Class is not responsible for data pointed to by a_dataPtr
171  */
172  void define(const Box& a_bx, int a_nComp, Real* a_dataPtr);
173  /**
174  Change this NodeFArrayBox so it covers the Box a_bx with a_nComps
175  components. If a_alias is not NULL, it is used as the data memory
176  (and is assumed to be large enough).
177  */
178  /*
179  void resize(const Box& a_bx, int a_nComp=1, Real* a_alias=NULL);
180  */
181  /*@}*/
182 
183  /**
184  \name Accessors
185  */
186  /*@{*/
187 
188  ///
189  /** Returns the CELL-centered domain where the array is defined.
190  */
191  const Box& box() const;
192 
193  ///
194  /** Returns a modifiable reference to the NODE-centered FArrayBox
195  containing the data.
196  */
197  FArrayBox& getFab();
198 
199  ///
200  /** Returns a constant reference to the NODE-centered FArrayBox
201  containing the data.
202  */
203  const FArrayBox& getFab() const;
204 
205  Real dotProduct(const NodeFArrayBox& a_fab2) const
206  {
207  return m_fab.dotProduct(a_fab2.m_fab);
208  }
209 
210  Real dotProduct(const NodeFArrayBox& a_fab2, const Box& box) const
211  {
212  return m_fab.dotProduct(a_fab2.m_fab, box);
213  }
214 
215  /*@}*/
216 
217  /**
218  \name Data modification functions
219  */
220  /*@{*/
221 
222  ///
223  /** Modifies the data in this NodeFArrayBox by copying data
224  from <i>a_src</i> into it, over the nodes that they have in common.<br>
225  If this NodeFArrayBox and <i>a_src</i> have abutting grids,
226  as shown:
227  <pre>
228  +--------+
229  | |
230  | this |
231  | |
232  ========== <- data copied here from a_src to this
233  | |
234  | a_src |
235  | |
236  +--------+
237  </pre>
238  then the data in this NodeFArrayBox WILL be modified along the
239  edge nodes where they abut -- even though this.box() and
240  <i>a_src</i>.box(), being CELL-centered, do NOT intersect.
241 
242  All components are copied.
243  */
244  void copy(const NodeFArrayBox& a_src);
245 
246  ///
247  /** Modifies the data in this NodeFArrayBox by copying the data
248  from <i>a_src</i> into it, over the intersection of:
249  - the nodes surrounding the CELL-centered box <i>a_regionFrom</i>;
250  - the nodes surrounding the CELL-centered box <i>a_regionTo</i>;
251  - the nodes containing data in this NodeFArrayBox;
252  - the nodes containing data in <i>a_src</i>.
253 
254  The components in the interval <i>a_Csrc</i> in <i>a_src</i>
255  are copied to the components in the interval <i>a_Cdest</i>
256  in this NodeFArrayBox.
257 
258  This function is required in order to have BoxLayoutData<NodeFArrayBox>.
259  */
260  void copy(const Box& a_regionFrom,
261  const Interval& a_Cdest,
262  const Box& a_regionTo,
263  const NodeFArrayBox& a_src,
264  const Interval& a_Csrc);
265 
266  /*@}*/
267 
268  /**
269  \name Linearization functions
270  */
271  /*@{*/
272 
273  ///
274  /** Returns size, in number of bytes, of a flat linear
275  representation of the data in this object in the area
276  defined by the nodes in CELL-centered box <i>a_R</i> and the
277  component Interval <i>a_comps</i>.
278 
279  This function is required in order to have BoxLayoutData<NodeFArrayBox>.
280  */
281  size_t size(const Box& a_R, const Interval& a_comps) const;
282 
283  ///
284  /** Writes into <i>a_buf</i> a linear representation of the internal data for
285  the nodes surrounding CELL-centered box <i>a_R</i>, over the component
286  Interval <i>a_comps</i>.
287 
288  Assumes that sufficient
289  memory for the buffer has already been allocated by the caller.
290 
291  This function is required in order to have BoxLayoutData<NodeFArrayBox>.
292  */
293  void linearOut(void* a_buf, const Box& a_R, const Interval& a_comps) const;
294 
295  ///
296  void linearIn(void* a_buf, const Box& a_R, const Interval& a_comps);
297 
298  /// These functions are required for broadcast & gather.
299  void linearOut(void* a_buf) const;
300  ///
301  void linearIn(const void* const a_buf);
302  ///
303  int linearSize(void) const;
304 
305  ///
306  static int preAllocatable()
307  {
308  return 0;
309  }
310 
311  /*@}*/
312 
313  ///
314  /**
315  Modifies this NodeFArrayBox so that all values of all components are set to
316  the given value, a_x. (FArrayBox inherits such a function from BaseFab.)
317  */
318  void setVal(Real a_x);
319 
320  /**
321  The setVal functions set subregions in the `BaseFab' to a constant value.
322  This most general form specifies the subbox, the starting component
323  number, and the number of components to be set.
324  */
325  void setVal(Real a_x,
326  const Box& a_bx,
327  int a_nstart,
328  int a_numcomp);
329 
330  ///
331  /** HERE
332  Returns the Lp-norm of this FAB using components
333  (a_comp : a_comp+a_numcomp-1) and within the a_subbox.
334  a_p < 0 -> ERROR
335  a_p = 0 -> infinity norm (max norm)
336  a_p = 1 -> sum of ABS(FAB)
337  a_p > 1 -> Lp-norm
338  */
339  Real norm(const Box& a_subbox,
340  int a_p = 2,
341  int a_comp = 0,
342  int a_numcomp = 1) const
343  {
344  return m_fab.norm(a_subbox, a_p, a_comp, a_numcomp);
345  }
346 
347  ///
348  /**
349  Returns the Lp-norm of this FAB using components
350  (a_comp : a_comp+a_numcomp-1).
351  a_p < 0 -> ERROR
352  a_p = 0 -> infinity norm (max norm)
353  a_p = 1 -> sum of ABS(FAB)
354  a_p > 1 -> Lp-norm
355  */
356  Real norm(int a_p = 2,
357  int a_comp = 0,
358  int a_numcomp = 1) const
359  {
360  return m_fab.norm(a_p, a_comp, a_numcomp);
361  }
362 
363  ///
364  /**
365  Returns sum of pow(fab[i,c],p): i in a_subbox, a_comp <= c <
366  a_comp+a_numcomp, a_p >= 2 only
367  */
368  Real sumPow(const Box& a_subbox,
369  int a_p = 2,
370  int a_comp = 0,
371  int a_numcomp = 1) const
372 
373  {
374  return m_fab.sumPow(a_subbox, a_p, a_comp, a_numcomp);
375  }
376 
377  ///
378  /**
379  Returns the minimum value of given component of this NodeFArrayBox.
380  */
381  Real min(int a_comp = 0) const
382  {
383  return m_fab.min(a_comp);
384  }
385 
386  ///
387  /**
388  Returns the minimum value of given component of this NodeFArrayBox in
389  given a_subbox.
390 
391  */
392  Real min(const Box& a_subbox,
393  int a_comp = 0) const
394  {
395  return m_fab.min(a_subbox, a_comp);
396  }
397 
398  ///
399  /**
400  Returns the maximum value of given component of this NodeFArrayBox.
401  */
402  Real max(int a_comp = 0) const
403  {
404  return m_fab.max(a_comp);
405  }
406 
407  ///
408  /**
409  Returns the maximum value of given component of this NodeFArrayBox in
410  given a_subbox.
411 
412  */
413  Real max(const Box& a_subbox,
414  int a_comp = 0) const
415 
416  {
417  return m_fab.max(a_subbox, a_comp);
418  }
419 
420  ///
421  /**
422  Finds location of minimum value in given component of this NodeFArrayBox.
423  */
424  IntVect minIndex(int a_comp = 0) const
425  {
426  return m_fab.minIndex(a_comp);
427  }
428 
429  ///
430  /**
431  Returns location of minimum value in given component of this NodeFArrayBox
432  in given a_subbox.
433  */
434  IntVect minIndex(const Box& a_subbox,
435  int a_comp = 0) const
436  {
437  return m_fab.minIndex(a_subbox, a_comp);
438  }
439 
440  ///
441  /**
442  Returns location of maximum value in given component of this NodeFArrayBox.
443  */
444  IntVect maxIndex(int a_comp = 0) const
445  {
446  return m_fab.maxIndex(a_comp);
447  }
448 
449  ///
450  /**
451  Returns location of maximum value in given component of this NodeFArrayBox
452  in given a_subbox.
453  */
454  IntVect maxIndex(const Box& a_subbox,
455  int a_comp = 0) const
456  {
457  return m_fab.maxIndex(a_subbox, a_comp);
458  }
459 
460  ///
461  /**
462  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
463  has value less than a_val, 0 otherwise. a_mask is resized by this
464  function. The number of cells marked with 1 returned.
465  */
466  int maskLT(BaseFab<int>& a_mask,
467  Real a_val,
468  int a_comp = 0) const
469  {
470  return m_fab.maskLT(a_mask, a_val, a_comp);
471  }
472 
473  ///
474  /**
475  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
476  has value less than or equal to a_val, 0 otherwise. a_mask is
477  resized by this function. The number of cells marked with 1
478  returned.
479  */
480  int maskLE(BaseFab<int>& a_mask,
481  Real a_val,
482  int a_comp = 0) const
483  {
484  return m_fab.maskLE(a_mask, a_val, a_comp);
485  }
486 
487  ///
488  /**
489  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
490  has value equal to a_val, 0 otherwise. a_mask is resized by this
491  function. The number of cells marked with 1 returned.
492 
493  */
494  int maskEQ(BaseFab<int>& a_mask,
495  Real a_val,
496  int a_comp = 0) const
497  {
498  return m_fab.maskEQ(a_mask, a_val, a_comp);
499  }
500 
501  ///
502  /**
503  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
504  has value greater than a_val, 0 otherwise. a_mask is resized by this
505  function. The number of cells marked with 1 returned.
506  */
507  int maskGT(BaseFab<int>& a_mask,
508  Real a_val,
509  int a_comp = 0) const
510  {
511  return m_fab.maskGT(a_mask, a_val, a_comp);
512  }
513 
514  ///
515  /**
516  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
517  has value greater than or equal to a_val, 0 otherwise. a_mask is
518  resized by this function. The number of cells marked with 1 returned.
519  */
520  int maskGE(BaseFab<int>& a_mask,
521  Real a_val,
522  int a_comp = 0) const
523  {
524  return m_fab.maskGE(a_mask, a_val, a_comp);
525  }
526 
527  ///
528  /**
529  Modifies this NodeFArrayBox by replacing each value with its absolute value.
530  */
531  void abs()
532  {
533  m_fab.abs();
534  }
535 
536  ///
537  /**
538  */
539  int nComp() const
540  {
541  return m_fab.nComp();
542  }
543 
544  ///
545  /**
546  Modifies this NodeFArrayBox by replacing each value with its absolute value,
547  for components (a_comp : a_comp+a_numcomp-1).
548  */
549  void abs(int a_comp,
550  int a_numcomp = 1)
551  {
552  m_fab.abs(a_comp, a_numcomp);
553  }
554 
555  ///
556  /**
557  Modifies this NodeFArrayBox by replacing eahc value with its absolute value,
558  for components (a_comp : a_comp+a_numcomp-1) and within the a_subbox.
559  */
560  void abs (const Box& a_subbox,
561  int a_comp = 0,
562  int a_numcomp = 1)
563  {
564  m_fab.abs(a_subbox, a_comp, a_numcomp);
565  }
566 
567  ///
568  /**
569  Returns sum of given component of NodeFArrayBox.
570  */
571  Real sum(int a_comp,
572  int a_numcomp = 1) const
573  {
574  return m_fab.sum(a_comp, a_numcomp);
575  }
576 
577  ///
578  /**
579  Returns sum of component of this NodeFArrayBox in given a_subbox.
580  */
581  Real sum(const Box& a_subbox,
582  int a_comp,
583  int a_numcomp = 1) const
584  {
585  return m_fab.sum(a_subbox, a_comp, a_numcomp);
586  }
587 
588  ///
589  /**
590  Modifies this NodeFArrayBox by replacing each value x with a_r/x.
591  */
593  {
594  m_fab.invert(a_r);
595  return *this;
596  }
597 
598  ///
599  /**
600  Modifies this NodeFArrayBox by replacing each value x with a_r/x. For
601  given range of components.
602  */
604  int a_comp,
605  int a_numcomp = 1)
606  {
607  m_fab.invert(a_r, a_comp, a_numcomp);
608  return *this;
609  }
610 
611  ///
612  /**
613  Modifies this NodeFArrayBox by replacing each value x with a_r/x. For
614  given range of components and within given a_subbox.
615  */
617  const Box& a_subbox,
618  int a_comp = 0,
619  int a_numcomp = 1)
620  {
621  m_fab.invert(a_r, a_subbox, a_comp, a_numcomp);
622  return *this;
623  }
624 
625  ///
626  /**
627  Modifies this NodeFArrayBox by replacing each value with its additive
628  inverse. For given range of components and within given a_subbox.
629  */
630  NodeFArrayBox& negate(const Box& a_subbox,
631  int a_comp = 0,
632  int a_numcomp = 1)
633  {
634  m_fab.negate(a_subbox, a_comp, a_numcomp);
635  return *this;
636  }
637 
638  ///
639  /**
640  Modifies this NodeFArrayBox by replacing each value with its additive
641  inverse. For given range of components.
642  */
643  NodeFArrayBox& negate(int a_comp,
644  int a_numcomp = 1)
645  {
646  m_fab.negate(a_comp, a_numcomp);
647  return *this;
648  }
649 
650  ///
651  /**
652  Modifies this NodeFArrayBox by replacing each value with its additive
653  inverse.
654  */
656  {
657  m_fab.negate();
658  return *this;
659  }
660 
661  ///
662  /**
663  Modifies this NodeFArrayBox by adding the scalar Real a_r to all values. For
664  given range of components and within given a_subbox.
665  */
667  const Box& a_subbox,
668  int a_comp = 0,
669  int a_numcomp = 1)
670  {
671  m_fab.plus(a_r, a_subbox, a_comp, a_numcomp);
672  return *this;
673  }
674 
675  ///
676  /**
677  Modifies this NodeFArrayBox by adding the scalar Real a_r to all values. For
678  given range of components.
679  */
681  int a_comp,
682  int a_numcomp = 1)
683  {
684  m_fab.plus(a_r, a_comp, a_numcomp);
685  return *this;
686  }
687 
688  ///
689  Real& operator() (const IntVect& a_p,
690  int N = 0)
691  {
692  return m_fab(a_p,N);
693  }
694 
695  ///
696  const Real& operator() (const IntVect& a_p,
697  int N = 0) const
698  {
699  return m_fab(a_p,N);
700  }
701  ///
702  /**
703  Modifies this NodeFArrayBox by adding the scalar Real a_r to all values.
704  */
706  {
707  m_fab += a_r;
708  return *this;
709  }
710 
711  ///
712  /**
713  Modifies this NodeFArrayBox by pointwise addition of the values of the
714  argument NodeFArrayBox. You might come to grief if the domains of the
715  NodeFArrayBoxes don't match.
716  */
718  {
719  m_fab += a_x.m_fab;
720  return *this;
721  }
722 
723  ///
724  /**
725  Modifies this NodeFArrayBox by adding the scalar Real a_r to all values.
726  */
728  {
729  m_fab += a_r;
730  return *this;
731  }
732 
734  {
735  return this->plus(a_r);
736  }
737 
738  ///
739  /**
740  Modifies this NodeFArrayBox by pointwise addition of the values of the
741  argument NodeFArrayBox. You might come to grief if the domains of the
742  NodeFArrayBoxes don't match. The same as += operator.
743 
744  */
746  {
747  m_fab += a_x.m_fab;
748  return *this;
749  }
750 
751  ///
752  /**
753  Modifies this NodeFArrayBox by pointwise scaled addition of the
754  argument NodeFArrayBox (a[i] <- a[i] + a_scale * a_src[i]). Uses domain
755  of the intersection of these two NodeFArrayBoxes.
756  */
758  const Real& a_scale)
759  {
760  m_fab.plus(a_src.m_fab, a_scale);
761  return *this;
762  }
763 
764  ///
765  /**
766  Modifies this NodeFArrayBox by pointwise scaled addition of the
767  argument NodeFArrayBox (a[i] <- a[i] + a_scale * a_src[i]). Uses domain
768  of the intersection of these two NodeFArrayBoxes.
769  */
771  const Real& a_scale,
772  int a_srccomp,
773  int a_destcomp,
774  int a_numcomp = 1)
775  {
776  m_fab.plus(a_src.m_fab, a_scale, a_srccomp, a_destcomp, a_numcomp);
777  return *this;
778  }
779 
780  ///
781  /**
782  Modifies this NodeFArrayBox by pointwise addition of values in the argument
783  NodeFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1)
784  to this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1)
785  where the domains of the two NodeFArrayBoxes intersect.
786  */
788  int a_srccomp,
789  int a_destcomp,
790  int a_numcomp = 1)
791  {
792  m_fab.plus(a_src.m_fab, a_srccomp, a_destcomp, a_numcomp);
793  return *this;
794  }
795 
796  ///
797  /**
798  Modifies this NodeFArrayBox by pointwise addition of values in the argument
799  NodeFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1)
800  to this NodeFArrayBox's components (a_destcomp : a_destcomp+numcomp-1)
801  where the domain of this NodeFArrayBox intersects the a_subbox. NOTE:
802  a_subbox must be contained in this FAB.
803  */
805  const Box& a_subbox,
806  int a_srccomp,
807  int a_destcomp,
808  int a_numcomp = 1)
809  {
810  m_fab.plus(a_src.m_fab, a_subbox, a_srccomp, a_destcomp, a_numcomp);
811  return *this;
812  }
813 
814  ///
815  /**
816  Modifies this NodeFArrayBox by pointwise addition of values in the argument
817  NodeFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1)
818  in the Box a_srcbox to this NodeFArrayBox's components (a_destcomp :
819  a_destcomp+a_numcomp-1) in the Box a_destbox. Corresponding locations
820  within the two NodeFArrayBoxes are indexed relative to a_srcbox and a_destbox,
821  and will in general not be the same. The a_srcbox and a_destbox must be
822  same size. The results are UNDEFINED if the a_src and dest NodeFArrayBoxes
823  are the same and the a_srcbox and a_destbox overlap.
824 
825  */
827  const Box& a_srcbox,
828  const Box& a_destbox,
829  int a_srccomp,
830  int a_destcomp,
831  int a_numcomp = 1)
832  {
833  m_fab.plus(a_src.m_fab, a_srcbox, a_destbox, a_srccomp, a_destcomp, a_numcomp);
834  return *this;
835  }
836 
837  ///
839  const Box& a_srcbox,
840  const Box& a_destbox,
841  const Real& a_scale,
842  int a_srccomp,
843  int a_destcomp,
844  int a_numcomp = 1)
845  {
846  m_fab.plus(a_src.m_fab, a_srcbox, a_destbox, a_scale, a_srccomp, a_destcomp, a_numcomp);
847  return *this;
848  }
849 
850  ///
851  /**
852  Modifies this NodeFArrayBox by subtracting the scalar Real a_r to all values.
853  Note: use plus(-a_r) for more general operations.
854  */
856  {
857  m_fab -= a_r;
858  return *this;
859  }
860 
861  ///
862  /**
863  Modifies this NodeFArrayBox by pointwise subtraction of the values of the
864  argument NodeFArrayBox. You might come to grief if the domains of the
865  NodeFArrayBoxes don't match.
866  */
868  {
869  m_fab -= a_x.m_fab;
870  return *this;
871  }
872 
873  ///
874  /**
875  Modifies this NodeFArrayBox by pointwise subtraction of the values of the
876  argument NodeFArrayBox. You might come to grief if the domains of the
877  NodeFArrayBoxes don't match. The same as -= operator.
878  */
880  {
881  m_fab -= a_x.m_fab;
882  return *this;
883  }
884 
885  /**
886  Modifies this NodeFArrayBox by pointwise subtraction of values in the
887  argument NodeFArrayBox. Subtracts a_src's components (a_srccomp :
888  a_srccomp+a_numcomp-1) from this NodeFArrayBox's components (a_destcomp :
889  a_destcomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes
890  intersect.
891  */
893  int a_srccomp,
894  int a_destcomp,
895  int a_numcomp = 1)
896  {
897  m_fab.minus(a_src.m_fab, a_srccomp, a_destcomp, a_numcomp);
898  return *this;
899  }
900 
901  /**
902  Modifies this NodeFArrayBox by pointwise subtraction of values in the
903  argument NodeFArrayBox. Subtracts a_src's components (a_srccomp :
904  a_srccomp+a_numcomp-1) from this NodeFArrayBox's components (a_destcomp :
905  a_destcomp+a_numcomp-1) where the domain of this NodeFArrayBox intersects
906  the a_subbox. NOTE: a_subbox must be contained in this FAB.
907  */
909  const Box& a_subbox,
910  int a_srccomp,
911  int a_destcomp,
912  int a_numcomp = 1)
913  {
914  m_fab.minus(a_src.m_fab, a_subbox, a_srccomp, a_destcomp, a_numcomp);
915  return *this;
916  }
917 
918  ///
919  /**
920  Modifies this NodeFArrayBox by pointwise subtraction of values in the
921  argument NodeFArrayBox. Subtracts a_src's components (a_srccomp :
922  a_srccomp+a_numcomp-1) in the Box a_srcbox from this NodeFArrayBox's
923  components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox.
924  Corresponding locations within the two NodeFArrayBoxes are indexed relative
925  to a_srcbox and a_destbox, and will in general not be the same. The
926  a_srcbox and a_destbox must be same size. The results are UNDEFINED
927  if the a_src and dest NodeFArrayBoxes are the same and the a_srcbox and
928  a_destbox overlap.
929  */
931  const Box& a_srcbox,
932  const Box& a_destbox,
933  int a_srccomp,
934  int a_destcomp,
935  int a_numcomp = 1)
936  {
937  m_fab.minus(a_src.m_fab, a_srcbox, a_destbox, a_srccomp, a_destcomp, a_numcomp);
938  return *this;
939  }
940 
941  ///
942  /**
943  Modifies this NodeFArrayBox by multiplying all values by the scalar Real a_r.
944  */
946  {
947  m_fab *= a_r;
948  return *this;
949  }
950 
951  ///
952  /**
953  Modifies this NodeFArrayBox by multiplying all values by the scalar Real a_r.
954  */
956  {
957  m_fab *= a_r;
958  return *this;
959  }
960 
961  ///
962  /**
963  Modifies this NodeFArrayBox by multiplying all values by the scalar
964  Real a_r. For given range of components.
965  */
967  int a_comp,
968  int a_numcomp = 1)
969  {
970  m_fab.mult(a_r, a_comp, a_numcomp);
971  return *this;
972  }
973 
974  ///
975  /**
976  Modifies this NodeFArrayBox by multiplying all values by the scalar
977  Real a_r. For given range of components and within given a_subbox.
978  */
980  const Box& a_subbox,
981  int a_comp = 0,
982  int a_numcomp = 1)
983  {
984  m_fab.mult(a_r, a_subbox, a_comp, a_numcomp);
985  return *this;
986  }
987 
988  ///
989  /**
990  Modifies this NodeFArrayBox by pointwise multiplication of the values by the
991  argument NodeFArrayBox. You might come to grief if the domains of the
992  NodeFArrayBoxes don't match.
993  */
995  {
996  m_fab *= a_x.m_fab;
997  return *this;
998  }
999 
1000  ///
1001  /**
1002  Modifies this NodeFArrayBox by pointwise multiplication by the values in the
1003  argument NodeFArrayBox. You might come to grief if the domains of the
1004  NodeFArrayBoxes don't match. The same as the *= operator.
1005  */
1007  {
1008  m_fab *= a_x.m_fab;
1009  return *this;
1010  }
1011 
1012  ///
1013  /**
1014  Modifies this NodeFArrayBox by pointwise multiplication by values in the
1015  argument NodeFArrayBox. Multiplies a_src's components (a_srccomp :
1016  a_srccomp+a_numcomp-1) by this NodeFArrayBox's components (a_destcomp :
1017  a_destcomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes
1018  intersect.
1019  */
1021  int a_srccomp,
1022  int a_destcomp,
1023  int a_numcomp = 1)
1024  {
1025  m_fab.mult(a_src.m_fab, a_srccomp, a_destcomp, a_numcomp);
1026  return *this;
1027  }
1028 
1029  ///
1030  /**
1031  Modifies this NodeFArrayBox by pointwise multiplication by values in the
1032  argument NodeFArrayBox. Multiplies a_src's components (a_srccomp :
1033  a_srccomp+a_numcomp-1) by this NodeFArrayBox's components (a_destcomp :
1034  a_destcomp+a_numcomp-1) where the domain of this NodeFArrayBox intersects
1035  the a_subbox. NOTE: a_subbox must be contained in this FAB.
1036  */
1038  const Box& a_subbox,
1039  int a_srccomp,
1040  int a_destcomp,
1041  int a_numcomp = 1)
1042  {
1043  m_fab.mult(a_src.m_fab, a_subbox, a_srccomp, a_destcomp, a_numcomp);
1044  return *this;
1045  }
1046 
1047  ///
1048  /**
1049  Modifies this NodeFArrayBox by pointwise multiplication by values in the
1050  argument NodeFArrayBox. Multiplies a_src's components (a_srccomp :
1051  a_srccomp+a_numcomp-1) in the Box a_srcbox by this NodeFArrayBox's
1052  components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox.
1053  Corresponding locations within the two NodeFArrayBoxes are indexed relative
1054  to a_srcbox and a_destbox, and will in general not be the same. The
1055  a_srcbox and a_destbox must be same size. The results are UNDEFINED if
1056  the a_src and dest NodeFArrayBoxes are the same and the a_srcbox and a_destbox
1057  overlap.
1058  */
1060  const Box& a_srcbox,
1061  const Box& a_destbox,
1062  int a_srccomp,
1063  int a_destcomp,
1064  int a_numcomp = 1)
1065  {
1066  m_fab.mult(a_src.m_fab, a_srcbox, a_destbox, a_srccomp, a_destcomp, a_numcomp);
1067  return *this;
1068  }
1069 
1070  ///
1071  /**
1072  Modifies this NodeFArrayBox by dividing all values by the scalar Real a_r.
1073  */
1075  {
1076  m_fab /= a_r;
1077  return *this;
1078  }
1079 
1080  ///
1081  /**
1082  Modifies this NodeFArrayBox by dividing all values by the scalar Real a_r.
1083  */
1085  {
1086  m_fab /= a_r;
1087  return *this;
1088  }
1089 
1090  ///
1091  /**
1092  Modifies this NodeFArrayBox by dividing all values by the scalar Real a_r.
1093  For given range of components.
1094  */
1096  int a_comp,
1097  int a_numcomp = 1)
1098  {
1099  m_fab.divide(a_r, a_comp, a_numcomp);
1100  return *this;
1101  }
1102 
1103  ///
1104  /**
1105  Modifies this NodeFArrayBox by dividing all values by the scalar Real
1106  a_r. For given range of components and within given a_subbox.
1107  */
1109  const Box& a_subbox,
1110  int a_comp = 0,
1111  int a_numcomp = 1)
1112  {
1113  m_fab.divide(a_r, a_subbox, a_comp, a_numcomp);
1114  return *this;
1115  }
1116 
1117  ///
1118  /**
1119  Modifies this NodeFArrayBox by pointwise division of the values by the
1120  argument NodeFArrayBox. You might come to grief if the domains of the
1121  NodeFArrayBoxes don't match.
1122  */
1124  {
1125  m_fab /= a_x.m_fab;
1126  return *this;
1127  }
1128 
1129  ///
1130  /**
1131  Modifies this NodeFArrayBox by pointwise division by the values in the
1132  argument NodeFArrayBox. You might come to grief if the domains of the
1133  NodeFArrayBoxes don't match. The same as the /= operator.
1134  */
1136  {
1137  m_fab /= a_x.m_fab;
1138  return *this;
1139  }
1140 
1141  ///
1142  /**
1143  Modifies this NodeFArrayBox by pointwise division by values in the argument
1144  NodeFArrayBox. Divides this NodeFArrayBox's components (a_destcomp :
1145  a_destcomp+a_numcomp-1) by a_src's components (a_srccomp :
1146  a_srccomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes intersect.
1147  */
1149  int a_srccomp,
1150  int a_destcomp,
1151  int a_numcomp = 1)
1152  {
1153  m_fab.divide(a_src.m_fab, a_srccomp, a_destcomp, a_numcomp);
1154  return *this;
1155  }
1156 
1157  ///
1158  /**
1159  Modifies this NodeFArrayBox by pointwise division by values in the argument
1160  NodeFArrayBox. Divides this NodeFArrayBox's components (a_destcomp :
1161  a_destcomp+a_numcomp-1) by a_src's components (a_srccomp :
1162  a_srccomp+a_numcomp-1) where the domain of this NodeFArrayBox intersects
1163  the a_subbox. NOTE: a_subbox must be contained in this FAB.
1164  */
1166  const Box& a_subbox,
1167  int a_srccomp,
1168  int a_destcomp,
1169  int a_numcomp = 1)
1170  {
1171  m_fab.divide(a_src.m_fab, a_subbox, a_srccomp, a_destcomp, a_numcomp);
1172  return *this;
1173  }
1174 
1175  ///
1176  /**
1177  Modifies this NodeFArrayBox by pointwise division by values in the argument
1178  NodeFArrayBox. Divides this NodeFArrayBox's components (a_destcomp :
1179  a_destcomp+a_numcomp-1) in the Box a_destbox by a_src's components
1180  (a_srccomp : a_srccomp+a_numcomp-1) in the Box a_srcbox. Corresponding
1181  locations within the two NodeFArrayBoxes are indexed relative to a_srcbox and
1182  a_destbox, and will in general not be the same. The a_srcbox and
1183  a_destbox must be same size. The results are UNDEFINED if the a_src and
1184  dest NodeFArrayBoxes are the same and the a_srcbox and a_destbox overlap.
1185  */
1187  const Box& a_srcbox,
1188  const Box& a_destbox,
1189  int a_srccomp,
1190  int a_destcomp,
1191  int a_numcomp = 1)
1192  {
1193  m_fab.divide(a_src.m_fab, a_srcbox, a_destbox, a_srccomp, a_destcomp, a_numcomp);
1194  return *this;
1195  }
1196  /**
1197  Returns the lower corner of the domain. Instead of returning them in
1198  the form of IntVects, as in smallEnd and bigEnd, it returns the values
1199  as a pointer to an array of constant integers. This is useful when
1200  interfacing to Fortran subroutines. It should not be used in any other
1201  context!!!
1202  */
1203  inline const int* loVect() const
1204  {
1205  return m_fab.loVect();
1206  }
1207 
1208  /**
1209  Returns the upper corner of the domain. Instead of returning them in
1210  the form of IntVects, as in smallEnd and bigEnd, it returns the values
1211  as a pointer to an array of constant integers. This is useful when
1212  interfacing to Fortran subroutines. It should not be used in any other
1213  context!!!
1214  */
1215  inline const int* hiVect() const
1216  {
1217  return m_fab.hiVect();
1218  }
1219 
1220  /**
1221  Returns a pointer to an integer that contains the number of components
1222  in the BaseFab. This is useful when interfacing to Fortran subroutines.
1223  It should not be used in any other context!!!
1224  */
1225  const int* nCompPtr() const
1226  {
1227  return m_fab.nCompPtr();
1228  }
1229  /**
1230  Returns a pointer to an object of type T that is the value of the a_nth
1231  component associated with the cell at the low end of the domain. This
1232  is commonly used to get a pointer to data in the array which is then
1233  handed off to a Fortran subroutine. It should not be used in any other
1234  context!!! Remember that data is stored in Fortran array order, with
1235  the component index coming last. In other words, `dataPtr' returns a
1236  pointer to all the a_nth components.
1237  */
1238  Real* dataPtr(int a_n = 0)
1239  {
1240  return m_fab.dataPtr(a_n);
1241  }
1242 
1243  /**
1244  Returns a constant pointer to an object of type T that is the value of
1245  the a_nth component associated with the cell at the low end of the domain.
1246  This is commonly used to get a pointer to data in the array which is
1247  then handed off to a Fortran subroutine. It should not be used in any
1248  other context!!! Remember that data is stored in Fortran array order,
1249  with the component index coming last. In other words, `dataPtr' returns
1250  a pointer to all the a_nth components.
1251  */
1252  const Real* dataPtr(int a_n = 0) const
1253  {
1254  return m_fab.dataPtr(a_n);
1255  }
1256 
1257 
1258  void shift(const IntVect& iv)
1259  {
1260  m_box.shift(iv);
1261  m_fab.shift(iv);
1262  }
1263 
1264 protected:
1265  // CELL-centered box. data are defined on the surrounding nodes.
1267 
1268  // NODE-centered data
1270 
1271 private:
1272  /// These are disallowed for performance reasons
1273 
1274  //NodeFArrayBox (const NodeFArrayBox&);
1275  //NodeFArrayBox& operator = (const NodeFArrayBox&);
1276 
1277 };
1278 
1279 #include "NamespaceFooter.H"
1280 #endif
Real norm(const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
Definition: NodeFArrayBox.H:339
Real norm(int a_p=2, int a_comp=0, int a_numcomp=1) const
Definition: NodeFArrayBox.H:356
NodeFArrayBox & plus(const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:787
Real sumPow(const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
Definition: NodeFArrayBox.H:368
void shift(const IntVect &iv)
Definition: NodeFArrayBox.H:1258
NodeFArrayBox & plus(const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:804
Real sum(int a_comp, int a_numcomp=1) const
NodeFArrayBox & minus(const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:908
int maskLT(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:466
int maskGT(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
NodeFArrayBox & plus(const NodeFArrayBox &a_src, const Real &a_scale, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:770
Real dotProduct(const FArrayBox &a_fab2) const
Return the dot product of this FArrayBox with another.
const int * loVect() const
{ Fortran interface functions}
Definition: BaseFabImplem.H:311
NodeFArrayBox & mult(const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1020
NodeFArrayBox & negate(const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:630
FArrayBox & negate(const Box &a_subbox, int a_comp=0, int a_numcomp=1)
FArrayBox & plus(Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
NodeFArrayBox & mult(const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1059
NodeFArrayBox & mult(Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:979
static int preAllocatable()
Definition: NodeFArrayBox.H:306
int maskEQ(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
int maskGE(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:520
NodeFArrayBox & negate()
Definition: NodeFArrayBox.H:655
BaseFab< T > & shift(const IntVect &a_v)
{ domain modification functions}
Definition: BaseFabImplem.H:471
const Real * dataPtr(int a_n=0) const
Definition: NodeFArrayBox.H:1252
const int * hiVect() const
Definition: NodeFArrayBox.H:1215
FArrayBox & invert(Real a_r)
const int * nCompPtr() const
Definition: NodeFArrayBox.H:1225
void copy(const NodeFArrayBox &a_src)
NodeFArrayBox & mult(Real a_r, int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:966
Real sum(int a_comp, int a_numcomp=1) const
Definition: NodeFArrayBox.H:571
Real max(int a_comp=0) const
Definition: NodeFArrayBox.H:402
void abs()
Definition: NodeFArrayBox.H:531
int maskGT(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:507
Real min(const Box &a_subbox, int a_comp=0) const
Definition: NodeFArrayBox.H:392
void setVal(Real a_x)
NodeFArrayBox & plus(Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:666
NodeFArrayBox & divide(Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:1108
NodeFArrayBox & minus(const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:892
FArrayBox & divide(Real a_r)
IntVect maxIndex(int a_comp=0) const
int nComp() const
{ accessors}
Definition: BaseFabImplem.H:219
Definition: EBInterface.H:45
Box m_box
Definition: NodeFArrayBox.H:1266
NodeFArrayBox & invert(Real a_r, int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:603
Real min(int a_comp=0) const
int maskEQ(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:494
Real max(const Box &a_subbox, int a_comp=0) const
Definition: NodeFArrayBox.H:413
NodeFArrayBox & divide(const NodeFArrayBox &a_x)
Definition: NodeFArrayBox.H:1135
Real * dataPtr(int a_n=0)
Definition: NodeFArrayBox.H:1238
NodeFArrayBox & divide(const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1165
const int * loVect() const
Definition: NodeFArrayBox.H:1203
void abs(const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:560
Structure for passing component ranges in code.
Definition: Interval.H:23
const Box & box() const
NodeFArrayBox & minus(const NodeFArrayBox &a_x)
Definition: NodeFArrayBox.H:879
int maskGE(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
virtual Real sumPow(const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
double Real
Definition: REAL.H:33
int maskLT(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
NodeFArrayBox & mult(const NodeFArrayBox &a_x)
Definition: NodeFArrayBox.H:1006
int linearSize(void) const
NodeFArrayBox & operator-=(Real a_r)
Definition: NodeFArrayBox.H:855
NodeFArrayBox & plus(const NodeFArrayBox &a_src, const Real &a_scale)
Definition: NodeFArrayBox.H:757
FArrayBox & minus(const FArrayBox &a_x)
int maskLE(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:480
NodeFArrayBox & operator=(NodeFArrayBox &&a_in)=default
NodeFArrayBox & plus(Real a_r)
Definition: NodeFArrayBox.H:727
IntVect minIndex(int a_comp=0) const
Real dotProduct(const NodeFArrayBox &a_fab2) const
Definition: NodeFArrayBox.H:205
int nComp() const
Definition: NodeFArrayBox.H:539
Real dotProduct(const NodeFArrayBox &a_fab2, const Box &box) const
Definition: NodeFArrayBox.H:210
NodeFArrayBox & divide(const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1186
const int * hiVect() const
Definition: BaseFabImplem.H:316
T * dataPtr(int a_n=0)
Definition: BaseFabImplem.H:328
FArrayBox & getFab()
NodeFArrayBox & operator*=(Real a_r)
Definition: NodeFArrayBox.H:945
NodeFArrayBox & negate(int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:643
Real max(int a_comp=0) const
void abs()
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
NodeFArrayBox & plus(const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:826
NodeFArrayBox & minus(const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:930
NodeFArrayBox & invert(Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:616
IntVect maxIndex(const Box &a_subbox, int a_comp=0) const
Definition: NodeFArrayBox.H:454
NodeFArrayBox(const Box &a_bx)
Definition: NodeFArrayBox.H:146
const int * nCompPtr() const
Definition: BaseFabImplem.H:321
Real & operator()(const IntVect &a_p, int N=0)
Definition: NodeFArrayBox.H:689
void define(const Box &a_bx, int a_nComp=1)
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
NodeFArrayBox & divide(Real a_r)
Definition: NodeFArrayBox.H:1084
NodeFArrayBox & mult(Real a_r)
Definition: NodeFArrayBox.H:955
NodeFArrayBox & plus(const NodeFArrayBox &a_x)
Definition: NodeFArrayBox.H:745
Box & shift(int dir, int nzones)
shift functions
Definition: Box.H:2067
void const char const int const int * N
Definition: Lapack.H:83
Real min(int a_comp=0) const
Definition: NodeFArrayBox.H:381
NodeFArrayBox & plus_real(Real a_r)
Definition: NodeFArrayBox.H:733
size_t size(const Box &a_R, const Interval &a_comps) const
Real sum(const Box &a_subbox, int a_comp, int a_numcomp=1) const
Definition: NodeFArrayBox.H:581
NodeFArrayBox & plus(Real a_r, int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:680
IntVect minIndex(const Box &a_subbox, int a_comp=0) const
Definition: NodeFArrayBox.H:434
IntVect minIndex(int a_comp=0) const
Definition: NodeFArrayBox.H:424
NodeFArrayBox & divide(const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1148
NodeFArrayBox & plus(const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, const Real &a_scale, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:838
IntVect maxIndex(int a_comp=0) const
Definition: NodeFArrayBox.H:444
virtual Real norm(const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
NodeFArrayBox & operator+=(Real a_r)
Definition: NodeFArrayBox.H:705
void linearIn(void *a_buf, const Box &a_R, const Interval &a_comps)
NodeFArrayBox & mult(const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1037
FArrayBox m_fab
Definition: NodeFArrayBox.H:1269
NodeFArrayBox & divide(Real a_r, int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1095
void linearOut(void *a_buf, const Box &a_R, const Interval &a_comps) const
NodeFArrayBox & operator/=(Real a_r)
Definition: NodeFArrayBox.H:1074
void abs(int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:549
int maskLE(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
NodeFArrayBox & invert(Real a_r)
Definition: NodeFArrayBox.H:592
A wrapper for an FArrayBox to contain NODE-centered data.
Definition: NodeFArrayBox.H:122
FArrayBox & mult(Real a_r)