00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _AMRPARTICLEPROJECTOR_H_
00029 #define _AMRPARTICLEPROJECTOR_H_
00030
00031
00033
00039 #include "DisjointBoxLayout.H"
00040 #include "LevelData.H"
00041 #include "BinFab.H"
00042 #include "DragParticle.H"
00043
00044 class AMRParticleProjector
00045 {
00046
00047 public:
00049 AMRParticleProjector();
00050
00052
00058 AMRParticleProjector(const Vector<DisjointBoxLayout>& a_vectGrids,
00059 const Vector<DisjointBoxLayout>& a_vectParticleGrids,
00060 const Vector<ProblemDomain>& a_vectDomain,
00061 const Vector<int>& a_vectRefRatio,
00062 const Vector<Real>& a_vectDx,
00063 const Vector<LevelData<BinFab<DragParticle> >* >& a_vectParticles,
00064 Real a_spreadingRadius,
00065 Real a_correctionRadius = 2,
00066 int a_gridsGrow=0);
00067
00069 ~AMRParticleProjector();
00070
00072 void define(const Vector<DisjointBoxLayout>& a_vectGrids,
00073 const Vector<DisjointBoxLayout>& a_vectParticleGrids,
00074 const Vector<ProblemDomain>& a_vectDomain,
00075 const Vector<int>& a_vectRefRatio,
00076 const Vector<Real>& a_vectDx,
00077 const Vector<LevelData<BinFab<DragParticle> >* >& a_vectParticles,
00078 Real a_spreadingRadius,
00079 Real a_correctionRadius = 2,
00080 int a_gridsGrow = 0);
00081
00083 void clear();
00084
00085
00087
00093 void projectForce(Vector<LevelData<FArrayBox>* >& a_vectForce,
00094 const Vector<LevelData<BinFab<DragParticle> >* >& a_particles);
00095
00096
00098 void setSpreadingRadius(const Real a_rad);
00099
00101 void setCorrectionRadius(const Real a_rad);
00102
00103
00105 Real getSpreadingRadius() const;
00106
00108 Real getCorrectionRadius() const;
00109
00111 void doImages(bool m_doImages);
00112
00114 bool doImages() const;
00115
00117
00120 void setGridsGrow(int a_gridsGrow);
00121
00123 void infDomainCoarsenFactor(int a_factor);
00124
00126 bool isDefined() const {return (m_isDefined && m_grownGridsDefined);};
00127
00129 bool grownGridsDefined() const {return m_grownGridsDefined;};
00130
00131
00133 void setVerbosity(int a_verbosity);
00134
00136 int verbosity() const;
00137
00139 void computeD(Vector<LevelData<FArrayBox>* >& a_vectD,
00140 const Vector<LevelData<BinFab<DragParticle> >* >& a_particles);
00141
00142
00143
00145 void solveForProjForce(Vector<LevelData<FArrayBox> *>& a_projectedForce,
00146 const Vector<LevelData<FArrayBox>* >& a_D,
00147 int a_lbase);
00148
00149
00151
00153 void defineImages(List<DragParticle>& a_imageParticles,
00154 const Vector<LevelData<BinFab<DragParticle> >* >& a_particles);
00155
00156
00157
00159
00164 void defineGrownGrids(const Vector<DisjointBoxLayout>& a_grids,
00165 const Vector<LevelData<BinFab<DragParticle> >* >& a_vectParticles);
00166
00167
00168
00169 protected:
00170
00172 void createImageParticle(DragParticle& a_image,
00173 const DragParticle& a_particle,
00174 Real bndryLoc, int dir,
00175 Side::LoHiSide a_side);
00176
00177
00178
00180 void setDefaultValues();
00181
00182
00183
00184
00185
00187 Vector<DisjointBoxLayout> m_vectGrids;
00188
00190 Vector<DisjointBoxLayout> m_vectParticleGrids;
00191
00193 Vector<DisjointBoxLayout> m_vectGrownGrids;
00194
00196 Vector<DisjointBoxLayout> m_vectGrownParticleGrids;
00197
00199 Vector<ProblemDomain> m_vectDomain;
00200
00202 Vector<ProblemDomain> m_vectGrownDomain;
00203
00205 Vector<int> m_vectRefRatio;
00206
00208 Vector<int> m_vectGrownRefRatio;
00209
00210
00212 Vector<Real> m_vectDx;
00213
00215 Vector<Real> m_vectGrownDx;
00216
00218 Real m_spreadingRadius;
00219
00221 Real m_correctionRadius;
00222
00223
00225
00228 int m_gridsGrow;
00229
00231 int m_infDomainCoarsenFactor;
00232
00234 List<DragParticle> m_imageParticles;
00235
00237 bool m_doImages;
00238
00240 bool m_returnInfDomBC;
00241
00243 bool m_isDefined;
00244
00245
00247 bool m_grownGridsDefined;
00248
00250 int m_verbosity;
00251
00252 private:
00253
00254
00255 AMRParticleProjector (const AMRParticleProjector& );
00256 AMRParticleProjector operator= (const AMRParticleProjector&);
00257
00258 };
00259
00260 #endif