15 #ifndef _LEVELDATAOPS_H_ 16 #define _LEVELDATAOPS_H_ 26 #include "NamespaceHeader.H" 94 #define ITER(a) for (DataIterator dit = a.dataIterator(); dit.ok(); ++dit) \ 113 a_rhs.
copyTo(interv, a_lhs, interv);
122 val += a_1[d].dotProduct(a_2[d], dbl.
get(d));
127 int result = MPI_Allreduce(&val, &recv, 1,
MPI_CH_REAL,
128 MPI_SUM, Chombo_MPI::comm);
131 std::ostringstream msg;
132 msg <<
"LevelDataOps::dotProduct() called MPI_Allreduce() which returned error code " << result ;
147 for (
int ii=0;ii<a_sz;ii++)
152 val += a_1[d].dotProduct(a_2[d], dbl.
get(d));
160 int result = MPI_Allreduce(a_mdots, recv, a_sz,
MPI_CH_REAL,
161 MPI_SUM, Chombo_MPI::comm);
164 std::ostringstream msg;
165 msg <<
"LevelDataOps::mDotProduct() called MPI_Allreduce() which returned error code " << result ;
168 for (
int ii=0;ii<a_sz;ii++)
170 a_mdots[ii] = recv[ii];
181 int numcomp = a_lhs.
nComp();
185 a_lhs[d].plus(a_rhs[d], subbox, subbox, a_scale, startcomp, startcomp, numcomp);
194 a_lhs[d] *= a_rhs[d];
202 a_lhs[d].setVal(0.0);
209 a_lhs[d].setVal(a_val);
216 int nComp = a_lhs.
nComp();
239 data.plus(a_y[d], b);
264 #include "NamespaceFooter.H"
LevelDataOps()
Definition: LevelDataOps.H:35
A reference-counting handle class.
Definition: RefCountedPtr.H:66
Definition: LevelDataOps.H:32
virtual void mult(LevelData< T > &a_lhs, const LevelData< T > &a_x)
Definition: LevelDataOps.H:190
virtual void axby(LevelData< T > &a_lhs, const LevelData< T > &a_x, const LevelData< T > &a_y, Real a_a, Real a_b)
Definition: LevelDataOps.H:231
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:137
virtual void setVal(LevelData< T > &a_lhs, const Real &a_val)
Definition: LevelDataOps.H:206
#define ENDFOR(a)
Definition: LevelDataOps.H:98
LevelDataOps(RefCountedPtr< DataFactory< T > > a_factoryPtr)
Definition: LevelDataOps.H:40
#define MPI_CH_REAL
Definition: REAL.H:34
Factory object to data members of a BoxLayoutData container.
Definition: BoxLayoutData.H:64
DataIndex toIndex
Definition: Copier.H:33
Structure for passing component ranges in code.
Definition: Interval.H:23
Definition: BoxLayoutData.H:136
virtual ~LevelDataOps()
Definition: LevelDataOps.H:45
virtual void setToZero(LevelData< T > &a_lhs)
Definition: LevelDataOps.H:199
double Real
Definition: REAL.H:33
virtual void scale(LevelData< T > &a_lhs, const Real &a_scale)
Definition: LevelDataOps.H:244
virtual void assign(LevelData< T > &a_lhs, const LevelData< T > &a_rhs)
Definition: LevelDataOps.H:110
virtual void define(const DisjointBoxLayout &dp, int comps, const IntVect &ghost=IntVect::Zero, const DataFactory< T > &a_factory=DefaultDataFactory< T >())
Definition: LevelDataI.H:70
virtual void copyTo(const Interval &srcComps, BoxLayoutData< T > &dest, const Interval &destComps) const
Definition: LevelDataI.H:164
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
Box get(const LayoutIndex &it) const
Definition: BoxLayout.H:681
#define ITER(a)
Definition: LevelDataOps.H:94
Box toRegion
Definition: Copier.H:35
const IntVect & ghostVect() const
Definition: LevelData.H:157
virtual void copyToZero(LevelData< T > &a_lhs, const Copier &a_copier)
Definition: LevelDataOps.H:214
virtual void plus(LevelData< T > &a_lhs, const Real &a_inc)
Definition: LevelDataOps.H:253
virtual void define(DataFactory< T > *a_rawPointer)
Definition: LevelDataOps.H:54
static void Warning(const char *const a_msg=m_nullString)
Print out message to cerr and continue.
virtual void mDotProduct(const LevelData< T > &a_1, const int a_sz, const LevelData< T > a_2arr[], Real a_mdots[])
Definition: LevelDataOps.H:143
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
int nComp() const
Definition: BoxLayoutData.H:258
const DisjointBoxLayout & disjointBoxLayout() const
Definition: LevelData.H:196
Factory object to data members of a BoxLayoutData container.
Definition: BoxLayoutData.H:30
bool ok() const
Definition: Copier.H:391
virtual void define(const RefCountedPtr< DataFactory< T > > &a_factoryPtr)
Definition: LevelDataOps.H:49
RefCountedPtr< DataFactory< T > > m_levelFactory
Definition: LevelDataOps.H:86
virtual Real dotProduct(const LevelData< T > &a_1, const LevelData< T > &a_2)
Definition: LevelDataOps.H:117
virtual void create(LevelData< T > &a_lhs, const LevelData< T > &a_rhs)
Definition: LevelDataOps.H:102
virtual void incr(LevelData< T > &a_lhs, const LevelData< T > &a_x, Real a_scale)
Definition: LevelDataOps.H:178