15 #ifndef _LEVELDATAOPS_H_ 16 #define _LEVELDATAOPS_H_ 26 #include "NamespaceHeader.H" 105 a_rhs.
copyTo(interv, a_lhs, interv);
114 #pragma omp parallel for reduction (+:val) 115 for(
int i=0; i<ompsize; i++)
118 val += a_1[d].dotProduct(a_2[d], dbl.
get(d));
124 int result = MPI_Allreduce(&val, &recv, 1,
MPI_CH_REAL,
125 MPI_SUM, Chombo_MPI::comm);
128 std::ostringstream msg;
129 msg <<
"LevelDataOps::dotProduct() called MPI_Allreduce() which returned error code " << result ;
144 for (
int ii=0;ii<a_sz;ii++)
149 #pragma omp parallel for reduction (+:val) 150 for(
int i=0; i<ompsize; i++)
153 val += a_1[d].dotProduct(a_2[d], dbl.
get(d));
161 int result = MPI_Allreduce(a_mdots, recv, a_sz,
MPI_CH_REAL,
162 MPI_SUM, Chombo_MPI::comm);
165 std::ostringstream msg;
166 msg <<
"LevelDataOps::mDotProduct() called MPI_Allreduce() which returned error code " << result ;
169 for (
int ii=0;ii<a_sz;ii++)
171 a_mdots[ii] = recv[ii];
182 int numcomp = a_lhs.
nComp();
185 #pragma omp parallel for 186 for(
int i=0; i<count; i++)
190 a_lhs[d].plus(a_rhs[d], subbox, subbox, a_scale, startcomp, startcomp, numcomp);
199 #pragma omp parallel for 200 for(
int i=0; i<count; i++)
203 a_lhs[d] *= a_rhs[d];
211 #pragma omp parallel for 212 for(
int i=0; i<count; i++)
215 a_lhs[d].setVal(0.0);
222 #pragma omp parallel for 223 for(
int i=0; i<count; i++)
226 a_lhs[d].setVal(a_val);
233 int nComp = a_lhs.
nComp();
239 #pragma omp for nowait 240 for (
int i=0; i<ccount; i++)
245 #pragma omp for nowait 246 for (
int i=0; i<tcount; i++)
259 #pragma omp parallel for 260 for(
int i=0; i<count; i++)
266 data.plus(a_y[d], b);
274 #pragma omp parallel for 275 for(
int i=0; i<count; i++)
287 #pragma omp parallel for 288 for(
int i=0; i<count; i++)
298 #include "NamespaceFooter.H"
LevelDataOps()
Definition: LevelDataOps.H:34
A reference-counting handle class.
Definition: RefCountedPtr.H:173
Definition: LevelDataOps.H:31
virtual void mult(LevelData< T > &a_lhs, const LevelData< T > &a_x)
Definition: LevelDataOps.H:195
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:255
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:152
virtual void setVal(LevelData< T > &a_lhs, const Real &a_val)
Definition: LevelDataOps.H:219
DataIterator dataIterator() const
Definition: LayoutDataI.H:78
Definition: DataIterator.H:190
size_t size()
Definition: Copier.H:424
LevelDataOps(RefCountedPtr< DataFactory< T > > a_factoryPtr)
Definition: LevelDataOps.H:39
#define MPI_CH_REAL
Definition: REAL.H:34
Factory object to data members of a BoxLayoutData container.
Definition: BoxLayoutData.H:70
DataIndex toIndex
Definition: Copier.H:41
int size() const
Definition: DataIterator.H:218
Structure for passing component ranges in code.
Definition: Interval.H:23
new code
Definition: BoxLayoutData.H:170
virtual ~LevelDataOps()
Definition: LevelDataOps.H:44
virtual void setToZero(LevelData< T > &a_lhs)
Definition: LevelDataOps.H:208
double Real
Definition: REAL.H:33
virtual void scale(LevelData< T > &a_lhs, const Real &a_scale)
Definition: LevelDataOps.H:271
virtual void assign(LevelData< T > &a_lhs, const LevelData< T > &a_rhs)
Definition: LevelDataOps.H:102
virtual void define(const DisjointBoxLayout &dp, int comps, const IntVect &ghost=IntVect::Zero, const DataFactory< T > &a_factory=DefaultDataFactory< T >())
Definition: LevelDataI.H:90
virtual void copyTo(const Interval &srcComps, BoxLayoutData< T > &dest, const Interval &destComps) const
Definition: LevelDataI.H:218
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
Box get(const LayoutIndex &it) const
Definition: BoxLayout.H:741
Box toRegion
Definition: Copier.H:43
const IntVect & ghostVect() const
Definition: LevelData.H:186
virtual void copyToZero(LevelData< T > &a_lhs, const Copier &a_copier)
Definition: LevelDataOps.H:231
virtual void plus(LevelData< T > &a_lhs, const Real &a_inc)
Definition: LevelDataOps.H:284
virtual void define(DataFactory< T > *a_rawPointer)
Definition: LevelDataOps.H:53
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:140
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
int nComp() const
Definition: BoxLayoutData.H:306
Definition: DataIndex.H:114
const DisjointBoxLayout & disjointBoxLayout() const
Definition: LevelData.H:225
Factory object to data members of a BoxLayoutData container.
Definition: BoxLayoutData.H:30
virtual void define(const RefCountedPtr< DataFactory< T > > &a_factoryPtr)
Definition: LevelDataOps.H:48
DataIterator dataIterator() const
Parallel iterator.
RefCountedPtr< DataFactory< T > > m_levelFactory
Definition: LevelDataOps.H:85
virtual Real dotProduct(const LevelData< T > &a_1, const LevelData< T > &a_2)
Definition: LevelDataOps.H:109
virtual void create(LevelData< T > &a_lhs, const LevelData< T > &a_rhs)
Definition: LevelDataOps.H:94
virtual void incr(LevelData< T > &a_lhs, const LevelData< T > &a_x, Real a_scale)
Definition: LevelDataOps.H:179