Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AMRParticleProjector.H

Go to the documentation of this file.
00001 /*   _______              __
00002     / ___/ /  ___  __ _  / /  ___
00003    / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00004    \___/_//_/\___/_/_/_/_.__/\___/
00005 */
00006 //
00007 // This software is copyright (C) by the Lawrence Berkeley
00008 // National Laboratory.  Permission is granted to reproduce
00009 // this software for non-commercial purposes provided that
00010 // this notice is left intact.
00011 //
00012 // It is acknowledged that the U.S. Government has rights to
00013 // this software under Contract DE-AC03-765F00098 between
00014 // the U.S.  Department of Energy and the University of
00015 // California.
00016 //
00017 // This software is provided as a professional and academic
00018 // contribution for joint exchange. Thus it is experimental,
00019 // is provided ``as is'', with no warranties of any kind
00020 // whatsoever, no support, no promise of updates, or printed
00021 // documentation. By using this software, you acknowledge
00022 // that the Lawrence Berkeley National Laboratory and
00023 // Regents of the University of California shall have no
00024 // liability with respect to the infringement of other
00025 // copyrights by any part of this software.
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   // data members -- note that we maintain two distinct grid hierachies
00183   // the original one, and a second one which is grown to account for
00184   // image particles.
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   // copy constructor illegal, etc
00255   AMRParticleProjector (const AMRParticleProjector& );
00256   AMRParticleProjector operator= (const AMRParticleProjector&);
00257 
00258 };
00259 
00260 #endif

Generated on Wed Jan 19 17:51:21 2005 for Chombo&INSwithParticles by doxygen1.2.16