00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef BL_MULTIFAB_H
00024 #define BL_MULTIFAB_H
00025
00026
00027
00028 #include <winstd.H>
00029
00030 #include <BLassert.H>
00031 #include <FArrayBox.H>
00032 #include <FabArray.H>
00033
00034
00035
00036 typedef FabArrayId MultiFabId;
00037
00038 class MultiFabCopyDescriptor;
00039
00040 class MultiFab;
00041
00042 namespace BoxLib
00043 {
00044 void linInterpAddBox (MultiFabCopyDescriptor& fabCopyDesc,
00045 BoxList* returnUnfilledBoxes,
00046 Array<FillBoxId>& returnedFillBoxIds,
00047 const Box& subbox,
00048 const MultiFabId& faid1,
00049 const MultiFabId& faid2,
00050 Real t1,
00051 Real t2,
00052 Real t,
00053 int src_comp,
00054 int dest_comp,
00055 int num_comp,
00056 bool extrap);
00057
00058 void linInterpFillFab (MultiFabCopyDescriptor& fabCopyDesc,
00059 const Array<FillBoxId>& fillBoxIds,
00060 const MultiFabId& faid1,
00061 const MultiFabId& faid2,
00062 FArrayBox& dest,
00063 Real t1,
00064 Real t2,
00065 Real t,
00066 int src_comp,
00067 int dest_comp,
00068 int num_comp,
00069 bool extrap);
00070 }
00071
00072
00073
00075
00088 class MultiFab
00089 :
00090 public FabArray<FArrayBox>
00091 {
00092 public:
00093
00098 MultiFab ();
00099
00109 MultiFab (const BoxArray& bs,
00110 int ncomp,
00111 int ngrow,
00112 FabAlloc mem_mode = Fab_allocate);
00113
00114 MultiFab (const BoxArray& bs,
00115 int ncomp,
00116 int ngrow,
00117 const DistributionMapping& dm,
00118 FabAlloc mem_mode);
00119
00120
00121 void operator= (const Real& r);
00127 Real min (int comp,
00128 int nghost = 0) const;
00129
00133 Real min (const Box& b,
00134 int comp,
00135 int nghost = 0) const;
00136
00142 Real max (int comp,
00143 int nghost = 0) const;
00144
00148 Real max (const Box& b,
00149 int comp,
00150 int nghost = 0) const;
00151
00159 void plus (Real val,
00160 int comp,
00161 int num_comp,
00162 int nghost = 0);
00163
00168 void plus (Real val,
00169 const Box& region,
00170 int comp,
00171 int num_comp,
00172 int nghost = 0);
00173
00179 void plus (Real val,
00180 int nghost);
00181
00189 void plus (Real val,
00190 const Box& region,
00191 int nghost);
00192
00200 void mult (Real val,
00201 int comp,
00202 int num_comp,
00203 int nghost = 0);
00204
00211 void mult (Real val,
00212 const Box& region,
00213 int comp,
00214 int num_comp,
00215 int nghost = 0);
00216
00222 void mult (Real val,
00223 int nghost = 0);
00224
00231 void mult (Real val,
00232 const Box& region,
00233 int nghost = 0);
00234
00242 void invert (Real numerator,
00243 int comp,
00244 int num_comp,
00245 int nghost = 0);
00246
00253 void invert (Real numerator,
00254 const Box& region,
00255 int comp,
00256 int num_comp,
00257 int nghost = 0);
00258
00264 void invert (Real numerator,
00265 int nghost);
00266
00273 void invert (Real numerator,
00274 const Box& region,
00275 int nghost);
00276
00283 void negate (int comp,
00284 int num_comp,
00285 int nghost = 0);
00286
00291 void negate (const Box& region,
00292 int comp,
00293 int num_comp,
00294 int nghost = 0);
00295
00300 void negate (int nghost = 0);
00301
00307 void negate (const Box& region,
00308 int nghost = 0);
00309
00319 void plus (const MultiFab& mf,
00320 int strt_comp,
00321 int num_comp,
00322 int nghost);
00323
00333 void minus (const MultiFab& mf,
00334 int strt_comp,
00335 int num_comp,
00336 int nghost);
00337
00343 void FillBoundary ();
00344
00348 void FillBoundary (int src_comp,
00349 int num_comp);
00350
00352
00353 static void FlushSICache ();
00354
00356
00357 static int SICacheSize ();
00358
00362 static void Copy (MultiFab& dst,
00363 const MultiFab& src,
00364 int srccomp,
00365 int dstcomp,
00366 int numcomp,
00367 int nghost);
00368 private:
00369
00370
00371
00372 MultiFab (const MultiFab& rhs);
00373 MultiFab& operator= (const MultiFab& rhs);
00374 };
00375
00376 class MultiFabCopyDescriptor
00377 :
00378 public FabArrayCopyDescriptor<FArrayBox>
00379 {
00380 public:
00381
00382 MultiFabCopyDescriptor ()
00383 :
00384 FabArrayCopyDescriptor<FArrayBox>() {}
00385
00386 MultiFabId RegisterMultiFab (MultiFab* mf)
00387 {
00388 return RegisterFabArray(mf);
00389 }
00390
00391 private:
00392
00393
00394
00395 MultiFabCopyDescriptor (const MultiFabCopyDescriptor&);
00396 MultiFabCopyDescriptor& operator= (const MultiFabCopyDescriptor&);
00397 };
00398
00399 #endif