Chombo + EB + MF  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  // it may be that the box being passed in is the relevant cell-centered box
213  if (box.cellCentered() )
214  {
215  Box nodeBox = box;
216  nodeBox.surroundingNodes();
217  return m_fab.dotProduct(a_fab2.m_fab, nodeBox);
218  }
219  else
220  {
221  return m_fab.dotProduct(a_fab2.m_fab, box);
222  }
223  }
224 
225  /*@}*/
226 
227  /**
228  \name Data modification functions
229  */
230  /*@{*/
231 
232  ///
233  /** Modifies the data in this NodeFArrayBox by copying data
234  from <i>a_src</i> into it, over the nodes that they have in common.<br>
235  If this NodeFArrayBox and <i>a_src</i> have abutting grids,
236  as shown:
237  <pre>
238  +--------+
239  | |
240  | this |
241  | |
242  ========== <- data copied here from a_src to this
243  | |
244  | a_src |
245  | |
246  +--------+
247  </pre>
248  then the data in this NodeFArrayBox WILL be modified along the
249  edge nodes where they abut -- even though this.box() and
250  <i>a_src</i>.box(), being CELL-centered, do NOT intersect.
251 
252  All components are copied.
253  */
254  void copy(const NodeFArrayBox& a_src);
255 
256  ///
257  /** Modifies the data in this NodeFArrayBox by copying the data
258  from <i>a_src</i> into it, over the intersection of:
259  - the nodes surrounding the CELL-centered box <i>a_regionFrom</i>;
260  - the nodes surrounding the CELL-centered box <i>a_regionTo</i>;
261  - the nodes containing data in this NodeFArrayBox;
262  - the nodes containing data in <i>a_src</i>.
263 
264  The components in the interval <i>a_Csrc</i> in <i>a_src</i>
265  are copied to the components in the interval <i>a_Cdest</i>
266  in this NodeFArrayBox.
267 
268  This function is required in order to have BoxLayoutData<NodeFArrayBox>.
269  */
270  void copy(const Box& a_regionFrom,
271  const Interval& a_Cdest,
272  const Box& a_regionTo,
273  const NodeFArrayBox& a_src,
274  const Interval& a_Csrc);
275 
276  /*@}*/
277 
278  /**
279  \name Linearization functions
280  */
281  /*@{*/
282 
283  ///
284  /** Returns size, in number of bytes, of a flat linear
285  representation of the data in this object in the area
286  defined by the nodes in CELL-centered box <i>a_R</i> and the
287  component Interval <i>a_comps</i>.
288 
289  This function is required in order to have BoxLayoutData<NodeFArrayBox>.
290  */
291  size_t size(const Box& a_R, const Interval& a_comps) const;
292 
293  ///
294  /** Writes into <i>a_buf</i> a linear representation of the internal data for
295  the nodes surrounding CELL-centered box <i>a_R</i>, over the component
296  Interval <i>a_comps</i>.
297 
298  Assumes that sufficient
299  memory for the buffer has already been allocated by the caller.
300 
301  This function is required in order to have BoxLayoutData<NodeFArrayBox>.
302  */
303  void linearOut(void* a_buf, const Box& a_R, const Interval& a_comps) const;
304 
305  ///
306  void linearIn(void* a_buf, const Box& a_R, const Interval& a_comps);
307 
308  /// These functions are required for broadcast & gather.
309  void linearOut(void* a_buf) const;
310  ///
311  void linearIn(const void* const a_buf);
312  ///
313  int linearSize(void) const;
314 
315  ///
316  static int preAllocatable()
317  {
318  return 0;
319  }
320 
321  /*@}*/
322 
323  ///
324  /**
325  Modifies this NodeFArrayBox so that all values of all components are set to
326  the given value, a_x. (FArrayBox inherits such a function from BaseFab.)
327  */
328  void setVal(Real a_x);
329 
330  /**
331  The setVal functions set subregions in the `BaseFab' to a constant value.
332  This most general form specifies the subbox, the starting component
333  number, and the number of components to be set.
334  */
335  void setVal(Real a_x,
336  const Box& a_bx,
337  int a_nstart,
338  int a_numcomp);
339 
340  ///
341  /** HERE
342  Returns the Lp-norm of this FAB using components
343  (a_comp : a_comp+a_numcomp-1) and within the a_subbox.
344  a_p < 0 -> ERROR
345  a_p = 0 -> infinity norm (max norm)
346  a_p = 1 -> sum of ABS(FAB)
347  a_p > 1 -> Lp-norm
348  */
349  Real norm(const Box& a_subbox,
350  int a_p = 2,
351  int a_comp = 0,
352  int a_numcomp = 1) const
353  {
354  return m_fab.norm(a_subbox, a_p, a_comp, a_numcomp);
355  }
356 
357  ///
358  /**
359  Returns the Lp-norm of this FAB using components
360  (a_comp : a_comp+a_numcomp-1).
361  a_p < 0 -> ERROR
362  a_p = 0 -> infinity norm (max norm)
363  a_p = 1 -> sum of ABS(FAB)
364  a_p > 1 -> Lp-norm
365  */
366  Real norm(int a_p = 2,
367  int a_comp = 0,
368  int a_numcomp = 1) const
369  {
370  return m_fab.norm(a_p, a_comp, a_numcomp);
371  }
372 
373  ///
374  /**
375  Returns sum of pow(fab[i,c],p): i in a_subbox, a_comp <= c <
376  a_comp+a_numcomp, a_p >= 2 only
377  */
378  Real sumPow(const Box& a_subbox,
379  int a_p = 2,
380  int a_comp = 0,
381  int a_numcomp = 1) const
382 
383  {
384  return m_fab.sumPow(a_subbox, a_p, a_comp, a_numcomp);
385  }
386 
387  ///
388  /**
389  Returns the minimum value of given component of this NodeFArrayBox.
390  */
391  Real min(int a_comp = 0) const
392  {
393  return m_fab.min(a_comp);
394  }
395 
396  ///
397  /**
398  Returns the minimum value of given component of this NodeFArrayBox in
399  given a_subbox.
400 
401  */
402  Real min(const Box& a_subbox,
403  int a_comp = 0) const
404  {
405  return m_fab.min(a_subbox, a_comp);
406  }
407 
408  ///
409  /**
410  Returns the maximum value of given component of this NodeFArrayBox.
411  */
412  Real max(int a_comp = 0) const
413  {
414  return m_fab.max(a_comp);
415  }
416 
417  ///
418  /**
419  Returns the maximum value of given component of this NodeFArrayBox in
420  given a_subbox.
421 
422  */
423  Real max(const Box& a_subbox,
424  int a_comp = 0) const
425 
426  {
427  return m_fab.max(a_subbox, a_comp);
428  }
429 
430  ///
431  /**
432  Finds location of minimum value in given component of this NodeFArrayBox.
433  */
434  IntVect minIndex(int a_comp = 0) const
435  {
436  return m_fab.minIndex(a_comp);
437  }
438 
439  ///
440  /**
441  Returns location of minimum value in given component of this NodeFArrayBox
442  in given a_subbox.
443  */
444  IntVect minIndex(const Box& a_subbox,
445  int a_comp = 0) const
446  {
447  return m_fab.minIndex(a_subbox, a_comp);
448  }
449 
450  ///
451  /**
452  Returns location of maximum value in given component of this NodeFArrayBox.
453  */
454  IntVect maxIndex(int a_comp = 0) const
455  {
456  return m_fab.maxIndex(a_comp);
457  }
458 
459  ///
460  /**
461  Returns location of maximum value in given component of this NodeFArrayBox
462  in given a_subbox.
463  */
464  IntVect maxIndex(const Box& a_subbox,
465  int a_comp = 0) const
466  {
467  return m_fab.maxIndex(a_subbox, a_comp);
468  }
469 
470  ///
471  /**
472  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
473  has value less than a_val, 0 otherwise. a_mask is resized by this
474  function. The number of cells marked with 1 returned.
475  */
476  int maskLT(BaseFab<int>& a_mask,
477  Real a_val,
478  int a_comp = 0) const
479  {
480  return m_fab.maskLT(a_mask, a_val, a_comp);
481  }
482 
483  ///
484  /**
485  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
486  has value less than or equal to a_val, 0 otherwise. a_mask is
487  resized by this function. The number of cells marked with 1
488  returned.
489  */
490  int maskLE(BaseFab<int>& a_mask,
491  Real a_val,
492  int a_comp = 0) const
493  {
494  return m_fab.maskLE(a_mask, a_val, a_comp);
495  }
496 
497  ///
498  /**
499  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
500  has value equal to a_val, 0 otherwise. a_mask is resized by this
501  function. The number of cells marked with 1 returned.
502 
503  */
504  int maskEQ(BaseFab<int>& a_mask,
505  Real a_val,
506  int a_comp = 0) const
507  {
508  return m_fab.maskEQ(a_mask, a_val, a_comp);
509  }
510 
511  ///
512  /**
513  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
514  has value greater than a_val, 0 otherwise. a_mask is resized by this
515  function. The number of cells marked with 1 returned.
516  */
517  int maskGT(BaseFab<int>& a_mask,
518  Real a_val,
519  int a_comp = 0) const
520  {
521  return m_fab.maskGT(a_mask, a_val, a_comp);
522  }
523 
524  ///
525  /**
526  Computes a_mask array with value of 1 in cells where this NodeFArrayBox
527  has value greater than or equal to a_val, 0 otherwise. a_mask is
528  resized by this function. The number of cells marked with 1 returned.
529  */
530  int maskGE(BaseFab<int>& a_mask,
531  Real a_val,
532  int a_comp = 0) const
533  {
534  return m_fab.maskGE(a_mask, a_val, a_comp);
535  }
536 
537  ///
538  /**
539  Modifies this NodeFArrayBox by replacing each value with its absolute value.
540  */
541  void abs()
542  {
543  m_fab.abs();
544  }
545 
546  ///
547  /**
548  */
549  int nComp() const
550  {
551  return m_fab.nComp();
552  }
553 
554  ///
555  /**
556  Modifies this NodeFArrayBox by replacing each value with its absolute value,
557  for components (a_comp : a_comp+a_numcomp-1).
558  */
559  void abs(int a_comp,
560  int a_numcomp = 1)
561  {
562  m_fab.abs(a_comp, a_numcomp);
563  }
564 
565  ///
566  /**
567  Modifies this NodeFArrayBox by replacing eahc value with its absolute value,
568  for components (a_comp : a_comp+a_numcomp-1) and within the a_subbox.
569  */
570  void abs (const Box& a_subbox,
571  int a_comp = 0,
572  int a_numcomp = 1)
573  {
574  m_fab.abs(a_subbox, a_comp, a_numcomp);
575  }
576 
577  ///
578  /**
579  Returns sum of given component of NodeFArrayBox.
580  */
581  Real sum(int a_comp,
582  int a_numcomp = 1) const
583  {
584  return m_fab.sum(a_comp, a_numcomp);
585  }
586 
587  ///
588  /**
589  Returns sum of component of this NodeFArrayBox in given a_subbox.
590  */
591  Real sum(const Box& a_subbox,
592  int a_comp,
593  int a_numcomp = 1) const
594  {
595  return m_fab.sum(a_subbox, a_comp, a_numcomp);
596  }
597 
598  ///
599  /**
600  Modifies this NodeFArrayBox by replacing each value x with a_r/x.
601  */
603  {
604  m_fab.invert(a_r);
605  return *this;
606  }
607 
608  ///
609  /**
610  Modifies this NodeFArrayBox by replacing each value x with a_r/x. For
611  given range of components.
612  */
614  int a_comp,
615  int a_numcomp = 1)
616  {
617  m_fab.invert(a_r, a_comp, a_numcomp);
618  return *this;
619  }
620 
621  ///
622  /**
623  Modifies this NodeFArrayBox by replacing each value x with a_r/x. For
624  given range of components and within given a_subbox.
625  */
627  const Box& a_subbox,
628  int a_comp = 0,
629  int a_numcomp = 1)
630  {
631  m_fab.invert(a_r, a_subbox, a_comp, a_numcomp);
632  return *this;
633  }
634 
635  ///
636  /**
637  Modifies this NodeFArrayBox by replacing each value with its additive
638  inverse. For given range of components and within given a_subbox.
639  */
640  NodeFArrayBox& negate(const Box& a_subbox,
641  int a_comp = 0,
642  int a_numcomp = 1)
643  {
644  m_fab.negate(a_subbox, a_comp, a_numcomp);
645  return *this;
646  }
647 
648  ///
649  /**
650  Modifies this NodeFArrayBox by replacing each value with its additive
651  inverse. For given range of components.
652  */
653  NodeFArrayBox& negate(int a_comp,
654  int a_numcomp = 1)
655  {
656  m_fab.negate(a_comp, a_numcomp);
657  return *this;
658  }
659 
660  ///
661  /**
662  Modifies this NodeFArrayBox by replacing each value with its additive
663  inverse.
664  */
666  {
667  m_fab.negate();
668  return *this;
669  }
670 
671  ///
672  /**
673  Modifies this NodeFArrayBox by adding the scalar Real a_r to all values. For
674  given range of components and within given a_subbox.
675  */
677  const Box& a_subbox,
678  int a_comp = 0,
679  int a_numcomp = 1)
680  {
681  m_fab.plus(a_r, a_subbox, a_comp, a_numcomp);
682  return *this;
683  }
684 
685  ///
686  /**
687  Modifies this NodeFArrayBox by adding the scalar Real a_r to all values. For
688  given range of components.
689  */
691  int a_comp,
692  int a_numcomp = 1)
693  {
694  m_fab.plus(a_r, a_comp, a_numcomp);
695  return *this;
696  }
697 
698  ///
699  Real& operator() (const IntVect& a_p,
700  int N = 0)
701  {
702  return m_fab(a_p,N);
703  }
704 
705  ///
706  const Real& operator() (const IntVect& a_p,
707  int N = 0) const
708  {
709  return m_fab(a_p,N);
710  }
711  ///
712  /**
713  Modifies this NodeFArrayBox by adding the scalar Real a_r to all values.
714  */
716  {
717  m_fab += a_r;
718  return *this;
719  }
720 
721  ///
722  /**
723  Modifies this NodeFArrayBox by pointwise addition of the values of the
724  argument NodeFArrayBox. You might come to grief if the domains of the
725  NodeFArrayBoxes don't match.
726  */
728  {
729  m_fab += a_x.m_fab;
730  return *this;
731  }
732 
733  ///
734  /**
735  Modifies this NodeFArrayBox by adding the scalar Real a_r to all values.
736  */
738  {
739  m_fab += a_r;
740  return *this;
741  }
742 
744  {
745  return this->plus(a_r);
746  }
747 
748  ///
749  /**
750  Modifies this NodeFArrayBox by pointwise addition of the values of the
751  argument NodeFArrayBox. You might come to grief if the domains of the
752  NodeFArrayBoxes don't match. The same as += operator.
753 
754  */
756  {
757  m_fab += a_x.m_fab;
758  return *this;
759  }
760 
761  ///
762  /**
763  Modifies this NodeFArrayBox by pointwise scaled addition of the
764  argument NodeFArrayBox (a[i] <- a[i] + a_scale * a_src[i]). Uses domain
765  of the intersection of these two NodeFArrayBoxes.
766  */
768  const Real& a_scale)
769  {
770  m_fab.plus(a_src.m_fab, a_scale);
771  return *this;
772  }
773 
774  ///
775  /**
776  Modifies this NodeFArrayBox by pointwise scaled addition of the
777  argument NodeFArrayBox (a[i] <- a[i] + a_scale * a_src[i]). Uses domain
778  of the intersection of these two NodeFArrayBoxes.
779  */
781  const Real& a_scale,
782  int a_srccomp,
783  int a_destcomp,
784  int a_numcomp = 1)
785  {
786  m_fab.plus(a_src.m_fab, a_scale, a_srccomp, a_destcomp, a_numcomp);
787  return *this;
788  }
789 
790  ///
791  /**
792  Modifies this NodeFArrayBox by pointwise addition of values in the argument
793  NodeFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1)
794  to this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1)
795  where the domains of the two NodeFArrayBoxes intersect.
796  */
798  int a_srccomp,
799  int a_destcomp,
800  int a_numcomp = 1)
801  {
802  m_fab.plus(a_src.m_fab, a_srccomp, a_destcomp, a_numcomp);
803  return *this;
804  }
805 
806  ///
807  /**
808  Modifies this NodeFArrayBox by pointwise addition of values in the argument
809  NodeFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1)
810  to this NodeFArrayBox's components (a_destcomp : a_destcomp+numcomp-1)
811  where the domain of this NodeFArrayBox intersects the a_subbox. NOTE:
812  a_subbox must be contained in this FAB.
813  */
815  const Box& a_subbox,
816  int a_srccomp,
817  int a_destcomp,
818  int a_numcomp = 1)
819  {
820  m_fab.plus(a_src.m_fab, a_subbox, a_srccomp, a_destcomp, a_numcomp);
821  return *this;
822  }
823 
824  ///
825  /**
826  Modifies this NodeFArrayBox by pointwise addition of values in the argument
827  NodeFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1)
828  in the Box a_srcbox to this NodeFArrayBox's components (a_destcomp :
829  a_destcomp+a_numcomp-1) in the Box a_destbox. Corresponding locations
830  within the two NodeFArrayBoxes are indexed relative to a_srcbox and a_destbox,
831  and will in general not be the same. The a_srcbox and a_destbox must be
832  same size. The results are UNDEFINED if the a_src and dest NodeFArrayBoxes
833  are the same and the a_srcbox and a_destbox overlap.
834 
835  */
837  const Box& a_srcbox,
838  const Box& a_destbox,
839  int a_srccomp,
840  int a_destcomp,
841  int a_numcomp = 1)
842  {
843  m_fab.plus(a_src.m_fab, a_srcbox, a_destbox, a_srccomp, a_destcomp, a_numcomp);
844  return *this;
845  }
846 
847  ///
849  const Box& a_srcbox,
850  const Box& a_destbox,
851  const Real& a_scale,
852  int a_srccomp,
853  int a_destcomp,
854  int a_numcomp = 1)
855  {
856  m_fab.plus(a_src.m_fab, a_srcbox, a_destbox, a_scale, a_srccomp, a_destcomp, a_numcomp);
857  return *this;
858  }
859 
860  ///
861  /**
862  Modifies this NodeFArrayBox by subtracting the scalar Real a_r to all values.
863  Note: use plus(-a_r) for more general operations.
864  */
866  {
867  m_fab -= a_r;
868  return *this;
869  }
870 
871  ///
872  /**
873  Modifies this NodeFArrayBox by pointwise subtraction of the values of the
874  argument NodeFArrayBox. You might come to grief if the domains of the
875  NodeFArrayBoxes don't match.
876  */
878  {
879  m_fab -= a_x.m_fab;
880  return *this;
881  }
882 
883  ///
884  /**
885  Modifies this NodeFArrayBox by pointwise subtraction of the values of the
886  argument NodeFArrayBox. You might come to grief if the domains of the
887  NodeFArrayBoxes don't match. The same as -= operator.
888  */
890  {
891  m_fab -= a_x.m_fab;
892  return *this;
893  }
894 
895  /**
896  Modifies this NodeFArrayBox by pointwise subtraction of values in the
897  argument NodeFArrayBox. Subtracts a_src's components (a_srccomp :
898  a_srccomp+a_numcomp-1) from this NodeFArrayBox's components (a_destcomp :
899  a_destcomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes
900  intersect.
901  */
903  int a_srccomp,
904  int a_destcomp,
905  int a_numcomp = 1)
906  {
907  m_fab.minus(a_src.m_fab, a_srccomp, a_destcomp, a_numcomp);
908  return *this;
909  }
910 
911  /**
912  Modifies this NodeFArrayBox by pointwise subtraction of values in the
913  argument NodeFArrayBox. Subtracts a_src's components (a_srccomp :
914  a_srccomp+a_numcomp-1) from this NodeFArrayBox's components (a_destcomp :
915  a_destcomp+a_numcomp-1) where the domain of this NodeFArrayBox intersects
916  the a_subbox. NOTE: a_subbox must be contained in this FAB.
917  */
919  const Box& a_subbox,
920  int a_srccomp,
921  int a_destcomp,
922  int a_numcomp = 1)
923  {
924  m_fab.minus(a_src.m_fab, a_subbox, a_srccomp, a_destcomp, a_numcomp);
925  return *this;
926  }
927 
928  ///
929  /**
930  Modifies this NodeFArrayBox by pointwise subtraction of values in the
931  argument NodeFArrayBox. Subtracts a_src's components (a_srccomp :
932  a_srccomp+a_numcomp-1) in the Box a_srcbox from this NodeFArrayBox's
933  components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox.
934  Corresponding locations within the two NodeFArrayBoxes are indexed relative
935  to a_srcbox and a_destbox, and will in general not be the same. The
936  a_srcbox and a_destbox must be same size. The results are UNDEFINED
937  if the a_src and dest NodeFArrayBoxes are the same and the a_srcbox and
938  a_destbox overlap.
939  */
941  const Box& a_srcbox,
942  const Box& a_destbox,
943  int a_srccomp,
944  int a_destcomp,
945  int a_numcomp = 1)
946  {
947  m_fab.minus(a_src.m_fab, a_srcbox, a_destbox, a_srccomp, a_destcomp, a_numcomp);
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 Real a_r.
964  */
966  {
967  m_fab *= a_r;
968  return *this;
969  }
970 
971  ///
972  /**
973  Modifies this NodeFArrayBox by multiplying all values by the scalar
974  Real a_r. For given range of components.
975  */
977  int a_comp,
978  int a_numcomp = 1)
979  {
980  m_fab.mult(a_r, a_comp, a_numcomp);
981  return *this;
982  }
983 
984  ///
985  /**
986  Modifies this NodeFArrayBox by multiplying all values by the scalar
987  Real a_r. For given range of components and within given a_subbox.
988  */
990  const Box& a_subbox,
991  int a_comp = 0,
992  int a_numcomp = 1)
993  {
994  m_fab.mult(a_r, a_subbox, a_comp, a_numcomp);
995  return *this;
996  }
997 
998  ///
999  /**
1000  Modifies this NodeFArrayBox by pointwise multiplication of the values by the
1001  argument NodeFArrayBox. You might come to grief if the domains of the
1002  NodeFArrayBoxes don't match.
1003  */
1005  {
1006  m_fab *= a_x.m_fab;
1007  return *this;
1008  }
1009 
1010  ///
1011  /**
1012  Modifies this NodeFArrayBox by pointwise multiplication by the values in the
1013  argument NodeFArrayBox. You might come to grief if the domains of the
1014  NodeFArrayBoxes don't match. The same as the *= operator.
1015  */
1017  {
1018  m_fab *= a_x.m_fab;
1019  return *this;
1020  }
1021 
1022  ///
1023  /**
1024  Modifies this NodeFArrayBox by pointwise multiplication by values in the
1025  argument NodeFArrayBox. Multiplies a_src's components (a_srccomp :
1026  a_srccomp+a_numcomp-1) by this NodeFArrayBox's components (a_destcomp :
1027  a_destcomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes
1028  intersect.
1029  */
1031  int a_srccomp,
1032  int a_destcomp,
1033  int a_numcomp = 1)
1034  {
1035  m_fab.mult(a_src.m_fab, a_srccomp, a_destcomp, a_numcomp);
1036  return *this;
1037  }
1038 
1039  ///
1040  /**
1041  Modifies this NodeFArrayBox by pointwise multiplication by values in the
1042  argument NodeFArrayBox. Multiplies a_src's components (a_srccomp :
1043  a_srccomp+a_numcomp-1) by this NodeFArrayBox's components (a_destcomp :
1044  a_destcomp+a_numcomp-1) where the domain of this NodeFArrayBox intersects
1045  the a_subbox. NOTE: a_subbox must be contained in this FAB.
1046  */
1048  const Box& a_subbox,
1049  int a_srccomp,
1050  int a_destcomp,
1051  int a_numcomp = 1)
1052  {
1053  m_fab.mult(a_src.m_fab, a_subbox, a_srccomp, a_destcomp, a_numcomp);
1054  return *this;
1055  }
1056 
1057  ///
1058  /**
1059  Modifies this NodeFArrayBox by pointwise multiplication by values in the
1060  argument NodeFArrayBox. Multiplies a_src's components (a_srccomp :
1061  a_srccomp+a_numcomp-1) in the Box a_srcbox by this NodeFArrayBox's
1062  components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox.
1063  Corresponding locations within the two NodeFArrayBoxes are indexed relative
1064  to a_srcbox and a_destbox, and will in general not be the same. The
1065  a_srcbox and a_destbox must be same size. The results are UNDEFINED if
1066  the a_src and dest NodeFArrayBoxes are the same and the a_srcbox and a_destbox
1067  overlap.
1068  */
1070  const Box& a_srcbox,
1071  const Box& a_destbox,
1072  int a_srccomp,
1073  int a_destcomp,
1074  int a_numcomp = 1)
1075  {
1076  m_fab.mult(a_src.m_fab, a_srcbox, a_destbox, a_srccomp, a_destcomp, a_numcomp);
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  */
1095  {
1096  m_fab /= a_r;
1097  return *this;
1098  }
1099 
1100  ///
1101  /**
1102  Modifies this NodeFArrayBox by dividing all values by the scalar Real a_r.
1103  For given range of components.
1104  */
1106  int a_comp,
1107  int a_numcomp = 1)
1108  {
1109  m_fab.divide(a_r, a_comp, a_numcomp);
1110  return *this;
1111  }
1112 
1113  ///
1114  /**
1115  Modifies this NodeFArrayBox by dividing all values by the scalar Real
1116  a_r. For given range of components and within given a_subbox.
1117  */
1119  const Box& a_subbox,
1120  int a_comp = 0,
1121  int a_numcomp = 1)
1122  {
1123  m_fab.divide(a_r, a_subbox, a_comp, a_numcomp);
1124  return *this;
1125  }
1126 
1127  ///
1128  /**
1129  Modifies this NodeFArrayBox by pointwise division of the values by the
1130  argument NodeFArrayBox. You might come to grief if the domains of the
1131  NodeFArrayBoxes don't match.
1132  */
1134  {
1135  m_fab /= a_x.m_fab;
1136  return *this;
1137  }
1138 
1139  ///
1140  /**
1141  Modifies this NodeFArrayBox by pointwise division by the values in the
1142  argument NodeFArrayBox. You might come to grief if the domains of the
1143  NodeFArrayBoxes don't match. The same as the /= operator.
1144  */
1146  {
1147  m_fab /= a_x.m_fab;
1148  return *this;
1149  }
1150 
1151  ///
1152  /**
1153  Modifies this NodeFArrayBox by pointwise division by values in the argument
1154  NodeFArrayBox. Divides this NodeFArrayBox's components (a_destcomp :
1155  a_destcomp+a_numcomp-1) by a_src's components (a_srccomp :
1156  a_srccomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes intersect.
1157  */
1159  int a_srccomp,
1160  int a_destcomp,
1161  int a_numcomp = 1)
1162  {
1163  m_fab.divide(a_src.m_fab, a_srccomp, a_destcomp, a_numcomp);
1164  return *this;
1165  }
1166 
1167  ///
1168  /**
1169  Modifies this NodeFArrayBox by pointwise division by values in the argument
1170  NodeFArrayBox. Divides this NodeFArrayBox's components (a_destcomp :
1171  a_destcomp+a_numcomp-1) by a_src's components (a_srccomp :
1172  a_srccomp+a_numcomp-1) where the domain of this NodeFArrayBox intersects
1173  the a_subbox. NOTE: a_subbox must be contained in this FAB.
1174  */
1176  const Box& a_subbox,
1177  int a_srccomp,
1178  int a_destcomp,
1179  int a_numcomp = 1)
1180  {
1181  m_fab.divide(a_src.m_fab, a_subbox, a_srccomp, a_destcomp, a_numcomp);
1182  return *this;
1183  }
1184 
1185  ///
1186  /**
1187  Modifies this NodeFArrayBox by pointwise division by values in the argument
1188  NodeFArrayBox. Divides this NodeFArrayBox's components (a_destcomp :
1189  a_destcomp+a_numcomp-1) in the Box a_destbox by a_src's components
1190  (a_srccomp : a_srccomp+a_numcomp-1) in the Box a_srcbox. Corresponding
1191  locations within the two NodeFArrayBoxes are indexed relative to a_srcbox and
1192  a_destbox, and will in general not be the same. The a_srcbox and
1193  a_destbox must be same size. The results are UNDEFINED if the a_src and
1194  dest NodeFArrayBoxes are the same and the a_srcbox and a_destbox overlap.
1195  */
1197  const Box& a_srcbox,
1198  const Box& a_destbox,
1199  int a_srccomp,
1200  int a_destcomp,
1201  int a_numcomp = 1)
1202  {
1203  m_fab.divide(a_src.m_fab, a_srcbox, a_destbox, a_srccomp, a_destcomp, a_numcomp);
1204  return *this;
1205  }
1206  /**
1207  Returns the lower corner of the domain. Instead of returning them in
1208  the form of IntVects, as in smallEnd and bigEnd, it returns the values
1209  as a pointer to an array of constant integers. This is useful when
1210  interfacing to Fortran subroutines. It should not be used in any other
1211  context!!!
1212  */
1213  inline const int* loVect() const
1214  {
1215  return m_fab.loVect();
1216  }
1217 
1218  /**
1219  Returns the upper corner of the domain. Instead of returning them in
1220  the form of IntVects, as in smallEnd and bigEnd, it returns the values
1221  as a pointer to an array of constant integers. This is useful when
1222  interfacing to Fortran subroutines. It should not be used in any other
1223  context!!!
1224  */
1225  inline const int* hiVect() const
1226  {
1227  return m_fab.hiVect();
1228  }
1229 
1230  /**
1231  Returns a pointer to an integer that contains the number of components
1232  in the BaseFab. This is useful when interfacing to Fortran subroutines.
1233  It should not be used in any other context!!!
1234  */
1235  const int* nCompPtr() const
1236  {
1237  return m_fab.nCompPtr();
1238  }
1239  /**
1240  Returns a pointer to an object of type T that is the value of the a_nth
1241  component associated with the cell at the low end of the domain. This
1242  is commonly used to get a pointer to data in the array which is then
1243  handed off to a Fortran subroutine. It should not be used in any other
1244  context!!! Remember that data is stored in Fortran array order, with
1245  the component index coming last. In other words, `dataPtr' returns a
1246  pointer to all the a_nth components.
1247  */
1248  Real* dataPtr(int a_n = 0)
1249  {
1250  return m_fab.dataPtr(a_n);
1251  }
1252 
1253  /**
1254  Returns a constant pointer to an object of type T that is the value of
1255  the a_nth component associated with the cell at the low end of the domain.
1256  This is commonly used to get a pointer to data in the array which is
1257  then handed off to a Fortran subroutine. It should not be used in any
1258  other context!!! Remember that data is stored in Fortran array order,
1259  with the component index coming last. In other words, `dataPtr' returns
1260  a pointer to all the a_nth components.
1261  */
1262  const Real* dataPtr(int a_n = 0) const
1263  {
1264  return m_fab.dataPtr(a_n);
1265  }
1266 
1267 
1268  void shift(const IntVect& iv)
1269  {
1270  m_box.shift(iv);
1271  m_fab.shift(iv);
1272  }
1273 
1274 protected:
1275  // CELL-centered box. data are defined on the surrounding nodes.
1277 
1278  // NODE-centered data
1280 
1281 private:
1282  /// These are disallowed for performance reasons
1283 
1284  //NodeFArrayBox (const NodeFArrayBox&);
1285  //NodeFArrayBox& operator = (const NodeFArrayBox&);
1286 
1287 };
1288 
1289 #include "NamespaceFooter.H"
1290 #endif
int maskGE(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:530
NodeFArrayBox & plus(const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:797
IntVect maxIndex(const Box &a_subbox, int a_comp=0) const
Definition: NodeFArrayBox.H:464
void shift(const IntVect &iv)
Definition: NodeFArrayBox.H:1268
NodeFArrayBox & plus(const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:814
IntVect maxIndex(int a_comp=0) const
Definition: NodeFArrayBox.H:454
int maskGT(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:517
NodeFArrayBox & minus(const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:918
NodeFArrayBox & plus(const NodeFArrayBox &a_src, const Real &a_scale, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:780
size_t size(const Box &a_R, const Interval &a_comps) const
NodeFArrayBox & mult(const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1030
const int * loVect() const
Definition: NodeFArrayBox.H:1213
NodeFArrayBox & negate(const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:640
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:1069
bool cellCentered() const
Definition: Box.H:1939
NodeFArrayBox & mult(Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:989
static int preAllocatable()
Definition: NodeFArrayBox.H:316
NodeFArrayBox & negate()
Definition: NodeFArrayBox.H:665
BaseFab< T > & shift(const IntVect &a_v)
{ domain modification functions}
Definition: BaseFabImplem.H:516
const int * hiVect() const
Definition: NodeFArrayBox.H:1225
Real sumPow(const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
Definition: NodeFArrayBox.H:378
Real sum(const Box &a_subbox, int a_comp, int a_numcomp=1) const
Definition: NodeFArrayBox.H:591
Real max(int a_comp=0) const
FArrayBox & invert(Real a_r)
virtual Real norm(const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
Real max(const Box &a_subbox, int a_comp=0) const
Definition: NodeFArrayBox.H:423
void copy(const NodeFArrayBox &a_src)
int maskEQ(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:504
NodeFArrayBox & mult(Real a_r, int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:976
IntVect maxIndex(int a_comp=0) const
Real sum(int a_comp, int a_numcomp=1) const
void abs()
Definition: NodeFArrayBox.H:541
Box & surroundingNodes()
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:676
NodeFArrayBox & divide(Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:1118
NodeFArrayBox & minus(const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:902
int maskEQ(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
FArrayBox & divide(Real a_r)
Real min(const Box &a_subbox, int a_comp=0) const
Definition: NodeFArrayBox.H:402
const int * nCompPtr() const
Definition: BaseFabImplem.H:366
const Box & box() const
const Real * dataPtr(int a_n=0) const
Definition: NodeFArrayBox.H:1262
virtual Real sumPow(const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
Real max(int a_comp=0) const
Definition: NodeFArrayBox.H:412
Box m_box
Definition: NodeFArrayBox.H:1276
int maskGE(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
void linearOut(void *a_buf, const Box &a_R, const Interval &a_comps) const
int maskGT(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
NodeFArrayBox & invert(Real a_r, int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:613
NodeFArrayBox & divide(const NodeFArrayBox &a_x)
Definition: NodeFArrayBox.H:1145
Real * dataPtr(int a_n=0)
Definition: NodeFArrayBox.H:1248
NodeFArrayBox & divide(const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1175
Real min(int a_comp=0) const
Definition: NodeFArrayBox.H:391
void abs(const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:570
Structure for passing component ranges in code.
Definition: Interval.H:23
int nComp() const
Definition: NodeFArrayBox.H:549
Real dotProduct(const FArrayBox &a_fab2) const
Return the dot product of this FArrayBox with another.
NodeFArrayBox & minus(const NodeFArrayBox &a_x)
Definition: NodeFArrayBox.H:889
double Real
Definition: REAL.H:33
NodeFArrayBox & mult(const NodeFArrayBox &a_x)
Definition: NodeFArrayBox.H:1016
const int * hiVect() const
Definition: BaseFabImplem.H:361
Real norm(int a_p=2, int a_comp=0, int a_numcomp=1) const
Definition: NodeFArrayBox.H:366
NodeFArrayBox & operator-=(Real a_r)
Definition: NodeFArrayBox.H:865
NodeFArrayBox & plus(const NodeFArrayBox &a_src, const Real &a_scale)
Definition: NodeFArrayBox.H:767
FArrayBox & minus(const FArrayBox &a_x)
NodeFArrayBox & operator=(NodeFArrayBox &&a_in)=default
NodeFArrayBox & plus(Real a_r)
Definition: NodeFArrayBox.H:737
IntVect minIndex(int a_comp=0) const
const int * nCompPtr() const
Definition: NodeFArrayBox.H:1235
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:1196
Real sum(int a_comp, int a_numcomp=1) const
Definition: NodeFArrayBox.H:581
int maskLE(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:490
T * dataPtr(int a_n=0)
Definition: BaseFabImplem.H:373
IntVect minIndex(const Box &a_subbox, int a_comp=0) const
Definition: NodeFArrayBox.H:444
FArrayBox & getFab()
NodeFArrayBox & operator*=(Real a_r)
Definition: NodeFArrayBox.H:955
NodeFArrayBox & negate(int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:653
void abs()
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
int maskLT(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
int maskLT(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
Definition: NodeFArrayBox.H:476
int maskLE(BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
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:836
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:940
Real dotProduct(const NodeFArrayBox &a_fab2, const Box &box) const
Definition: NodeFArrayBox.H:210
NodeFArrayBox & invert(Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
Definition: NodeFArrayBox.H:626
NodeFArrayBox(const Box &a_bx)
Definition: NodeFArrayBox.H:146
Real & operator()(const IntVect &a_p, int N=0)
Definition: NodeFArrayBox.H:699
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
IntVect minIndex(int a_comp=0) const
Definition: NodeFArrayBox.H:434
NodeFArrayBox & divide(Real a_r)
Definition: NodeFArrayBox.H:1094
Real min(int a_comp=0) const
Real norm(const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
Definition: NodeFArrayBox.H:349
NodeFArrayBox & mult(Real a_r)
Definition: NodeFArrayBox.H:965
NodeFArrayBox & plus(const NodeFArrayBox &a_x)
Definition: NodeFArrayBox.H:755
const int * loVect() const
{ Fortran interface functions}
Definition: BaseFabImplem.H:356
Box & shift(int dir, int nzones)
shift functions
Definition: Box.H:2083
int nComp() const
{ accessors}
Definition: BaseFabImplem.H:264
void const char const int const int * N
Definition: Lapack.H:83
NodeFArrayBox & plus_real(Real a_r)
Definition: NodeFArrayBox.H:743
Real dotProduct(const NodeFArrayBox &a_fab2) const
Definition: NodeFArrayBox.H:205
NodeFArrayBox & plus(Real a_r, int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:690
NodeFArrayBox & divide(const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1158
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:848
NodeFArrayBox & operator+=(Real a_r)
Definition: NodeFArrayBox.H:715
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:1047
FArrayBox m_fab
Definition: NodeFArrayBox.H:1279
NodeFArrayBox & divide(Real a_r, int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:1105
int linearSize(void) const
NodeFArrayBox & operator/=(Real a_r)
Definition: NodeFArrayBox.H:1084
void abs(int a_comp, int a_numcomp=1)
Definition: NodeFArrayBox.H:559
NodeFArrayBox & invert(Real a_r)
Definition: NodeFArrayBox.H:602
A wrapper for an FArrayBox to contain NODE-centered data.
Definition: NodeFArrayBox.H:122
FArrayBox & mult(Real a_r)